Discuss / Python / 玥儿

玥儿

Topic source

#1 Created at ... [Delete] [Delete and Lock User]

str1 = input("请输入a值:")

str2 = input("请输入b值:")

if str1.isdigit():

a = int(str1)

if str2.isdigit():

b = int(str2)

if a > 10:

print("a的b次方=",a**b)

else:

print("请输入大于10的数字")

终于成功了,谢谢老师,哈哈哈

无耐。

#2 Created at ... [Delete] [Delete and Lock User]

- -为什么你要加入 a>10..

穿越英豪

#3 Created at ... [Delete] [Delete and Lock User]

那个条件啊,if a>10 是条件成立后就打印a**b,不成立就提示你输入其他数字


  • 1

Reply