Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,3 @@
while(True):
x = input("What is your age? ")
print(x)

View file

@ -0,0 +1,6 @@
my_file = open(filename, 'r')
try:
for line in my_file:
pass # process line, includes newline
finally:
my_file.close()

View file

@ -0,0 +1,5 @@
#from __future__ import with_statement # is not needed in Python 3.6
with open(filename, 'r') as f:
for line in f:
pass # process line, includes newline

View file

@ -0,0 +1,2 @@
line = my_file.readline() # returns a line from the file
lines = my_file.readlines() # returns a list of the rest of the lines from the file

View file

@ -0,0 +1,3 @@
import fileinput
for line in fileinput.input():
pass # process line, includes newline