Write a program using pseudocode to store your name, class, section in a text file.
yourName=input("Enter your name: ")
yourClass=input("Enter your class: ")
yourSection=input("Enter your section: ")
with open('data.txt', 'w') as file:
file.write("Name: "+yourName+"\n")
file.write("Class: "+yourClass+"\n")
file.write("Section: "+yourSection+"\n")
Comments
Leave a comment