|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
0.缩进
1.520
2.
age = 18
isMale = True
print("抱歉,未满18岁禁止访问。") if age < 18 else print("任君选购!") if isMale else print("抱歉,本店商品可能不适合小公举哦~")
3."love" and 520 or 404
4.print(a) if a<c else c if a < b else b if b < c else c
---------------------------dds
0.
alcohol = int(input("input the amount of alcohol:"))
if alcohol < 20:
print("no alcohol")
elif 20 <= alcohol <80:
print("already alcohol")
elif alcohol >= 80:
print("bad alcohol")
else:
print("input is not right!")
1.
num = int(input("please input your number:"))
while num != 1:
1.
n = int(input("请输入一个正整数:"))
while n > 0:
# 判断 n 是否可以被 2 整除 #
# 按题目要求打印输出 #
# 如果能够被 2 整除,应该写什么表达式?#
if n%2 == 0:
print(n,"/2 = ",n/2,sep = '')
n /=2
else:
# 按题目要求打印输出 #
# 如果不能被 2 整除,应该写什么表达式?#
print(n,"*3+1 = ",n*3+1,sep = '')
n = n*3+1
if n == 1:
break
**************************************
4.
print(a) if a < c else print(c) if a < b else print(b) if b < c else print(c)
|
|