Question about Python coding


#1

Hello everyone! Firstly, I hope u guys all had a great Halloween!
Then, I have a question about my work. I dont know why it doesnt run at all!

Thank you in advance for any help!


#2

on repl.it, you can save the file, then copy the url, then we can the code here on the forum, how cool is that? :slight_smile:

its running fine, but writing to a file causes no output in terminal

after writing to the file, you can open it in read mode, and print each line.


#3

Hi! I send you the link of my work. Thank you so much for your response!
Please let me know if you have a trouble with opening it !


#4

like i said, writing to a file causes no output in the terminal


#5

Burt like how. Sorry but I dont know what u mean about that. Would u mind show it to me, please!

Thank you so much!


#6

this is the terminal:

Screenshot_2017-11-02_21-22-14

writing to a file, causes all output to be stored in the file.

If you want the output in the terminal, you would have to open the file again, read the file content and use print to print it to the terminal


#7

Thank you so much for your help.
So I will save the file, but I dont know what u mean about opening and reading the content, and then PRINT to the terminal.
Could u show me how please! Thank you so so much again


#8

take this course:

https://www.codecademy.com/courses/learn-python/lessons/file-inputoutput/exercises/see-it-to-believe-it?action=lesson_resume

it covers writing (which you already did) and reading from file


#9

Thank you so much for your help. However, there is something wrong that says I can not access this course yet. Do you know why?


#10

You need to do the exercises in order. Then i would recommend finding a source to read about basic python file operations


#11

Ok. I get what you say. Thank you so much.


#12

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.