最新回答 / qirenhou
i=input('请输入两位数字:')a=i[0]b=i[1]if b>a: print(f'个位数{b}大于十位数{a}')elif b==a: print(f'个位数{b}等于十位数{a}')else: print(f'个位数{b}小于十位数{a}')
2022-04-15
num = 0
sum = 0
while True:
if num > 1000:
break
sum = sum + num
num = num + 2
print (sum)
我觉得这样就看可以哦
sum = 0
while True:
if num > 1000:
break
sum = sum + num
num = num + 2
print (sum)
我觉得这样就看可以哦
2022-04-10
最赞回答 / 索罗斯7922145
可以。不过建议你这样写age=17if age>=18: print('adult') print('your age is {}'.format(age))else: print('teenager') print('your age is {}'.format(age))
2022-04-08
age=18
if age<3:
print('baby')
elif age>=3 and age<6:
print('kid')
elif age>=6 and age<18:
print('teenager')
else:
print('adult')
if age<3:
print('baby')
elif age>=3 and age<6:
print('kid')
elif age>=6 and age<18:
print('teenager')
else:
print('adult')
2022-04-08
print(type(3.1415926));
print(type('Learn Python in imooc.'));
print(type(100));
print(type(0b1101));
print(type('Learn Python in imooc.'));
print(type(100));
print(type(0b1101));
2022-04-02
template='life {i},you {n}'
i="is short,"
n="need python"
result=template.format(i='is short,',n='need pytonn')
print(result)
i="is short,"
n="need python"
result=template.format(i='is short,',n='need pytonn')
print(result)
2022-03-31
a=字符=True,所以a or 'world'=a 所以结果是hello,python
b=空字符串=False,所以b or 'world'=world,所以结果是hello,world
b=空字符串=False,所以b or 'world'=world,所以结果是hello,world
2022-03-30