OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How does the following while loop code work? [closed]

  • Thread starter Thread starter vishnu
  • Start date Start date
V

vishnu

Guest
Code:
fileinp=open('mar.txt'.'r')
while str:
    str=fileinp.readline()

    print(str)
fileinp.close()

How does the while loop in this code work and what does while str: mean?
<pre><code>fileinp=open('mar.txt'.'r')
while str:
str=fileinp.readline()

print(str)
fileinp.close()
</code></pre>
<p>How does the while loop in this code work and what does <code>while str:</code> mean?</p>
 
Top