码迷,mamicode.com
首页 > 编程语言 > 详细

【python练习题】程序1

时间:2018-04-29 14:26:07      阅读:161      评论:0      收藏:0      [点我收藏+]

标签:span   col   and   重复   style   重复数   bsp   数字   组成   

#题目:有1、2、3、4个数字,能组成多少个互不相同且无重复数字的三位数?都是多少?

count = 0

for i in range(1,5):
    for j in range(1,5):
        for k in range(1,5):
            if i != j and j != k and i != k:
                print (i*100 + j *10 + k)
                count += 1

print (count)

 

【python练习题】程序1

标签:span   col   and   重复   style   重复数   bsp   数字   组成   

原文地址:https://www.cnblogs.com/yelublue/p/8970828.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!