Advertisement
MRH3ADSH0T

Palindrome finder using python 3

Apr 8th, 2020
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. """
  2. Call functon 'f' with numerical a numerical argument 't'.  The program will run for 't' seconds and output any palindromic numbers it calculates.
  3. Created by MRH3ADSH0T
  4. """
  5. from timeit import default_timer as dt
  6.  
  7. def f(t):
  8.     x=0
  9.     st=dt()
  10.     while (dt()-st<=t):
  11.         if (str(x)[::-1] == str(x)):
  12.             print("Palindrome: "+str(x))
  13.         else:
  14.             #print(x)
  15.             pass
  16.         x+=1
  17.  
  18.  
  19. f(2.5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement