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="Moltiplicazioni: \n"
- b=input("Inserisci Tabellina: ")
- b=int(b)
- c=input("continua fino a: ")
- c=int(c)
- f=input("Salvare i dati?[1=Completo,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("Inserire nome file: ")
- 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"
- else:
- print("fail")
- a.append(e)
- print(str(b)+" * "+str(d)+" = "+str(e))
- d=d+1
- if gi:
- stri=stri+"Risultati:"+"\n"
- stri=stri+str(a)
- print(stri)
- print("Numeri:")
- print(a)
- if gi:
- filed=open(g,"w")
- filed.write(stri)
- while True:
- tabe()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement