0

In python how to read input data like a file from console?

3rd Jan 2023, 2:26 PM
Dadaxon Xudayberganov 👑 🇺🇿🇺🇿
Dadaxon Xudayberganov 👑 🇺🇿🇺🇿 - avatar
4 Answers
+ 7
Dadaxon Xudayberganov 🇺🇿🇺🇿🇺🇿 , it would be helpful if you could make an input sample. > to read from a file, we have to open this file to read the whole content or a part of the content > how will the input from the console should be done? line by line?
3rd Jan 2023, 4:47 PM
Lothar
Lothar - avatar
+ 4
read input from the console like a file you need to import the sys.stdin library This will read each line of input from the console and print it. I hope this helps
3rd Jan 2023, 4:15 PM
Sokkai
Sokkai - avatar
5th Jan 2023, 11:50 AM
Sokkai
Sokkai - avatar
+ 2
Thanks YIPMONG Jr .it is helpful
5th Jan 2023, 11:49 AM
Dadaxon Xudayberganov 👑 🇺🇿🇺🇿
Dadaxon Xudayberganov 👑 🇺🇿🇺🇿 - avatar