Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def tabe():
- global a,b,c,d,e,f,g,h
- import random,sys,os
- BaseRandom=random.randint(-99999999999999999999,99999999999999999999)
- BaseRandom=str(BaseRandom)+".txt"
- a=[]
- stri="Multiplication: \n"
- b=input("Enter multiplication table: ")
- b=int(b)
- c=input("Continues until: ")
- c=int(c)
- f=input("Save the data?[1=yes,0=no]: ")
- try:
- f=int(f)
- print(f)
- except TypeError:
- f=0
- print(type(f))
- if f!=1:
- bool("False")
- elif f==1:
- gi=bool("True")
- print(gi)
- if gi!=0:
- g=input("Insert file name: ")
- if g=="":
- g=BaseRandom
- else:
- g=g+".txt"
- d=0
- while d<=c:
- e=b*d
- if gi:
- stri=stri+str(b)+" * "+str(d)+" = "+str(e)+"\n"
- a.append(e)
- print(str(b)+" * "+str(d)+" = "+str(e))
- d=d+1
- if gi:
- stri=stri+"Results:"+"\n"
- stri=stri+str(a)
- print(stri)
- print("Numbers:")
- print(a)
- if gi:
- filed=open(g,"w")
- filed.write(stri)
- while True:
- tabe()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement