www.ypnh.net > 请用python写一个代码,题目,输入一个三位数,将...

请用python写一个代码,题目,输入一个三位数,将...

a = input('请输入') print('输入为',a) print('输出为',a[::-1])

a = input("输入一个三位数")print (str(a % 10 % 10) + str(a % 100 / 10) + str(a / 100))

print(' '.join(map(str, (i for i in xrange(100, 100000) if sum(int(c)**3 for c in str(i))==i))))

import randomdef gen3num(): alldigit=[0,1,2,3,4,5,6,7,8,9] first=random.randint(1,9) alldigit.remove(first) second=random.choice(alldigit) alldigit.remove(second) third=random.choice(alldigit) return first*100+second*10+thirdif...

#!/usr/bin/python for i in range(1,20): n=str(i) s = n.zfill(3) print s 或者 for i in range(1,20): m = "%03d" % i print m

机器人重现人间

for i in range(100,1000): if i%17==0: print(i)

python3不再支持print表达式,改为用print()函数。所以以后用print一定要加括号: print(i,j,k)

1、 #!python3from random import randintl=[randint(1,10000) for i in range(1000)]2、 l3=sorted([i for i in l if i

#-*coding:utf-8-*d=[1,2,3,4]def getnum(num,digit,length): num1=num for i in range(len(digit)): num=num1*10+digit[i] if length==3: yield num elif length

网站地图

All rights reserved Powered by www.ypnh.net

copyright ©right 2010-2021。
www.ypnh.net内容来自网络,如有侵犯请联系客服。zhit325@qq.com