1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
from math import pi
def circle6(r): s = pi * r**2 c = 2*pi return s, c circle6(6)
def sayHello(): print('Hello World!')
sayHello()
def say(s): print(s) say('Hello!') say('How are you!')
def f(n): s = 1 if n == 0: pass elif n > 0 and int(n) == n: for i in range(1,n+1): s *= i else: return '输入有误' return f'{n}!={s}'
print(f(6)) print(f(16)) print(f(26)) for i in range(5,1,-1): print(i)
def sushu(n): for i in range(2,int(n/2)): if n % i == 0: print('不是素数') return 0 print('是素数') return 1 sushu(int(input()))
for i in range(100,1000): s = 0 for j in str(i): s += int(j)**3 if s == i: print(i)
|