Prakhar - Python KNR

3 / 4

Python - File Copying

In python, we use open() command to load a file and then read() command to read the file.

INSTRUCTIONS
  • Create a text file
  • Put following text and save it as code.txt

lower = 0 upper = 300 step = 20 fahr = lower while (fahr<=upper): celcius = 5*(fahr-32)/9 print(fahr, " " , celcius) fahr = fahr + step

  • Open the file with the open command of python
  • Read and print the text
See Answer

No hints are availble for this assesment


Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...