0

Help me I want to store a name and score in a file.

name = ("Chiken")
score = 7
classroom_num = int(input("Please enter your classroom number"))
f = open("Classroom %d.txt","w") % (classroom_num)
f.write(name, score)
f.close()
Alexander
  • 105,104
  • 32
  • 201
  • 196
  • 1
    `f = open("Classroom %d..txt" %classroom_num, 'w')` and `f.write(name + " " + str(score) + '\n')` – inspectorG4dget Oct 18 '15 at 16:35
  • When you post questions about Python, please include the full tracebck of the error you received, if you did received one. This code has a couple of errors that should have caused exceptions to be raised. – skrrgwasme Oct 18 '15 at 16:40

0 Answers0