Bez popisu

pi_string.py 417B

123456789101112131415
  1. filename = 'pi_million_digits.txt'
  2. with open(filename) as file_object:
  3. lines = file_object.readlines()
  4. pi_string = ''
  5. for line in lines:
  6. pi_string += line.rstrip()
  7. birthday = input("Enter your birthday, in the form mmddyy: ")
  8. if birthday in pi_string:
  9. print("Your birthday appears in the first million digits of pi!")
  10. else:
  11. print("Your birthday does not appear in the first million digits of pi.")