使用for in 循环语句打印九九乘法表 for a in range(1,10):strs = '\t'for b in range(1,a+1):strs+=(str(b)+'*'+str(a)+'='+str(a*b)+'\t')print(strs) 通过数学计算计算数字的个位十位百位 a=234b=a//100s=a%100//10g=a%10print(b,s,g)
x = input('Please input a number:')s = str(x)sign = Truefor i in range(int(len(s)/2)):if s[i]!= s[-1-i]:sign = Falsebreakif sign:print('It is a plaindrome')else:print('It is not a plaindrome')