Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def array10 (array):
- if (len(array) == 1):
- return False
- if (array[0]*10 == array[1]):
- return True
- return (array10(array[1:]))
- def allStar(line):
- if (len(line) == 1):
- return (line)
- x = line[0]
- return (x + '*'+allStar(line[1:]))
- def changePi(line):
- if (len(line) < 2):
- return line
- x = line[0]
- y = line[1]
- if (x == 'p' and y == 'i'):
- return ('3.14'+changePi(line[2:]))
- return (x+changePi(line[1:]))
- def harmonicsum (x):
- if (x<1):
- return None
- if (x == 1):
- return 1
- return (1/x + harmonicsum(x-1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement