题目:给一个不多于5位的正整数,要求:一、求它是几位数,二、逆序打印出各位数字。x = int(input("input a number:"))a = x // 10000________________c = x % 1000 // 100d = x % 100 // 10e = x % 10if a != 0: print ("there are 5 ",e,d,c,b,a)elif b != 0: print ("there are 4 ",d,c,b,a)elif c != 0: print ("there are 3 ",e,d,c)elif d != 0: print ("there are 2 ",e,d)else: print ("there are 1",e)
A: b = x // 10000 // 1000
B: b = x % 10000 // 1000
C: b = x // 10000 % 1000
D: b = x % 10000 % 1000
A: b = x // 10000 // 1000
B: b = x % 10000 // 1000
C: b = x // 10000 % 1000
D: b = x % 10000 % 1000
举一反三
- 下面代码的输出结果是 x=10 y=3 print(x**y) A: 10 B: 100 C: 1000 D: 10000
- if x > 10: print("x=", x) elif x > 0: print("x=", 2 * x) elif x >- 2: print("x=" ,x + 5) else: print("x=", -x) 当输入的x的值为 10 和 -2 的时候,代码输出的结果分别为( ):
- 1.以下“if-elif-else”程序正确的是() A: if x>;yprint(x)elif y>;zprint(y)print(z) B: if x>;y:print(x)elif y>;z:print(y)else:print(z) C: if x>;y:print(x)elif x>;y:print(y)else:print(z) D: if x>;yprint(x)elif y>;zprint(y)elseprint(z)
- 【单选题】2.以下 if 语句语法正确的是()。 A. if(x>0) print(x) Else print(-x) B. If x>0 print(x) else print(-x) C. if x>0: Print(x) Else print(-x) D. if x>0: Print(x) else:print(-x) A. if(x>0) print(x) Else print(-x) B. if x>0: Print(x) Else print(-x) D. B. If x>0 print(x) else print(-x) C. if x>0: Print(x) Else print(-x) D. if x>0: Print(x) else:print(-x)
- 在以下if语法正确的是()。 A: if (x>0) print(x)else print(-x) B: if x>0print(x)else print(-x) C: if x>0:print(x)elseprint(-x) D: if x>0:print(x)else:print(-x)