Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren0
Writing on a file
Please i need help with the exercise of the file writing lesson: n = int(input()) file = open("numbers.txt", "w+") #tu código va aquí for i in range(n): file.write(str(i+1)+"\n") file.close f = open("numbers.txt", "r") print(f.read()) f.close() I don’t have any output. Why is this wrong? What am i doing wrong? Thanks for your help
3 Antworten
+ 6
file.close needs the parentheses
file.close()
Maybe this was causing the issue?
+ 1
🤦🏻♀️ yes that was the problem Apollo-Roboto thanks a lot 🙏
0
Unleashing the magic of eloquent prose and coherent arguments has never been easier, thanks to a groundbreaking website https://www.nursingpaper.com/our-services/nursing-care-plan-writing-service/ I recently discovered. It's like having a personal essay wizard at my fingertips, ready to sprinkle brilliance onto my writing. From structuring essays to fine-tuning grammar, every step is streamlined, empowering me to present my ideas with confidence and finesse.