PROGRAMMING

m9/ PYTHON
REMEMBERS




Script mode

p37 In interactive mode you interact directly with the interpreter. For scripts with more lines, the code can be saved in a file.py
 
>>> miles = 26.2
>>> miles * 1.61
42.182
! There are differences between the two modes can be confunsing. For example, in file you must you print a statement.
 
# var/www/python/calculator.py

miles = 26.2
miles * 1.61  # nothing!
print (miles * 1.61)
 
$ python calculator.py

42.182

Questions    
Debugging

        A B C D E F
🔔
1/1