Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- import random
- def inp(f,msg1,msg2):
- a=input(msg1)
- if f(a):
- return a
- else:
- print(msg2)
- return inp(f,msg1,msg2)
- line=lambda:print("~~~~~~~~~~~~~~~~~~~~")
- number=r"(0|([1-9]+[0-9]*))"
- isnum=lambda x:re.search(number,x)
- def gen_list():
- line()
- num=inp(isnum,"Please, enter number: ","Please, try again:<")
- print([random.randint(0,100) for i in range(0,int(num))])
- line()
- def final():
- gen_list()
- a=input("Exit?[0 - no,1 - yes]: ")
- if a=="1":
- print("Thank you for using! =3")
- else:
- final()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement