renix1

Tabuada simples, Python 3.X

Oct 14th, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. # coding: utf-8
  2.  
  3. def main():
  4.     nT = int(input("Digite qual tabuada quer: "))
  5.     if nT < 0:
  6.         nT *= -1
  7.     tInicio = int(input("Número de início da tabuada: "))
  8.     if tInicio == 0:
  9.         print("Digite outro valor!\n")
  10.         main()
  11.     else:
  12.         tFinal = int(input("Número final para a tabuada: "))
  13.         if len(str(tFinal)) < 1:
  14.             pass
  15.         for x in range(tInicio, tFinal+1, 1):
  16.             print("O resultado de %d x %d é %d" % (nT, x, nT*x))
  17. while True:
  18.     main()
Advertisement
Add Comment
Please, Sign In to add comment