CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
jackfrued

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: jackfrued/Python-100-Days
Path: blob/master/Day01-15/code/Day11/file2.py
Views: 729
1
"""
2
读取圆周率文件判断其中是否包含自己的生日
3
4
Version: 0.1
5
Author: 骆昊
6
Date: 2018-03-13
7
"""
8
9
birth = input('请输入你的生日: ')
10
with open('pi_million_digits.txt') as f:
11
lines = f.readlines()
12
pi_string = ''
13
for line in lines:
14
pi_string += line.strip()
15
if birth in pi_string:
16
print('Bingo!!!')
17
18