This Module will offer an introduction to encryption and file Input/Output.
Can you explain how the secret message, "Hello my name is Simon", was encrypted in each of the following?
Some recommended resources about encryption
"""
For a summary of file input/output in Python:
https://www.tutorialspoint.com/python/python_files_io.htm
Pay attention to placement of file pointer for various access modes
"""
filename = input("name your doc for your marks") #will create file if it doesn't already exist
numEntries = int(input("how many marks you got?"))
f=open(filename+".txt",'w') #'a' will append instead of overwrite
for mark in range(numEntries):
f.write(input("Enter your marks: ")+"\n")
f.close()
Here's a Codecademy tutorial about File I/O for reference
for line in f:
print(line)
for line in f:
print(line)
f.readline()
Post Your File IO Top 10 Scores Exercise here. It's a public repo
This work and other materials under
github.com/ICS4U-ICS4C,
are licensed under Creative Commons Attribution 4.0 Int'l License.