Can someone help me ? Please šŸ˜ | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 6

Can someone help me ? Please šŸ˜

Can I use for loops to get a word from a text like : file called "hello.txt" ( just writes hello or hey there šŸ˜‘ ) can i find a word in it's text and edit it using for loops like for "hello" in "hello.txt": print("hey there")

7th Oct 2017, 4:22 PM
warlord
warlord - avatar
2 Respostas
+ 6
@Carlos AndrƩs Hidalgo Martƭ but how I tried to use the readlines with for loops like for "hello" in file.readlines
7th Oct 2017, 6:45 PM
warlord
warlord - avatar
+ 1
Of course, you should review the file writing and reading part of the python course, there it is.
7th Oct 2017, 6:18 PM
Carlos Hidalgo
Carlos Hidalgo - avatar