Advertisement
Jenssile

random using time

Feb 20th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.36 KB | None | 0 0
  1. import time
  2.  
  3. def tr1(i):
  4.     dis = time.time() # gets current time
  5.     dem = dis-int(dis) # remove's numbers before the "."
  6.     final = float(dem) * 10 # converts to a round number that is no more than 1 digit long
  7.     z = int(final)
  8.     return z
  9.    
  10. def tr2(i):
  11.     dis = time.time() # gets current time
  12.     dem = dis-int(dis) # remove's numbers before the "."
  13.     final = float(dem) * 100 # converts to a round number that is no more than 2 digits long
  14.     z = int(final)
  15.     return z
  16.  
  17. def tr3(x):
  18.     dis = time.time() # gets current time
  19.     dem = dis-int(dis) # remove's numbers before the "."
  20.     final = float(dem) * 1000 # converts to a round number that is no more than 3 digits long
  21.     z = int(final)
  22.     return z
  23.  
  24. def tr4(i):
  25.     dis = time.time() # gets current time
  26.     dem = dis-int(dis) # remove's numbers before the "."
  27.     temp = float(dem) * 10000000 # converts to a round number that is no more than 7 digits long
  28.     final = temp / 192307.77 # makes sure that the result is not over 51
  29.     z = int(final)
  30.     return z
  31.  
  32. def tr5(x):
  33.     dis = time.time() # gets current time
  34.     dem = dis-int(dis) # remove's the number before the "."
  35.     temp = float(dem) * 10 # converts to a round number that is no more than 1 digit long
  36.     temp2 = int(temp) + 1 # makes it a number form 1 to 10 and not 0 to 9
  37.     final = temp2 * 1000 # gives a number between 1000 and 10000
  38.     z = int(final)
  39.     return z
  40.  
  41. def tr6(i):
  42.     dis = time.time() # gets current time
  43.     dem = dis-int(dis) # remove's the number before the "."
  44.     temp = float(dem) * 10 # converts to a round number that is no more than 1 digit long
  45.     final = int(temp) + 1 # makes it a number form 1 to 10 and not 0 to 9
  46.     z = int(final)
  47.     return z
  48.  
  49. def tr7(i):
  50.     dis = time.time() # gets current time
  51.     dem = dis-int(dis) # remove's the number before the "."
  52.     temp = float(dem) * 10 # converts to a round number that is no more than 1 digit long
  53.     final = int(temp) + 30 # makes it a number form 30 to 39 and not 0 to 9
  54.     z = int(final)
  55.     return z
  56.  
  57. def tr8(i):
  58.     dis = time.time() # gets current time
  59.     dem = dis-int(dis) # remove's the number before the "."
  60.     temp = float(dem) * 10 # converts to a round number that is no more than 1 digit long
  61.     final = int(temp) + 10 # makes it a number form 10 to 19 and not 0 to 9
  62.     z = int(final)
  63.     return z
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement