Nov-27-2022, 12:11 AM
name =input("what is your name?") sipCard =int(input("What is your sip card")) twoforone =int(input("How many of the two for one deals would you like?")) #monthly record with open ("MonthlyRecord.txt")as f: f.write (name) f.write (sipCard) f.write (twoforone) f.close() f = open("MonthlyRecord.txt", "r") print(f.read())
Output:what is your name?mehri
What is your sip card123
How many of the two for one deals would you like?3
Error:Traceback (most recent call last):
File "C:/Users/StaR/AppData/Local/Programs/Python/Python311/file.py", line 6, in <module>
with open ("MonthlyRecord.txt")as f:
FileNotFoundError: [Errno 2] No such file or directory: 'MonthlyRecord.txt'