Learn › Class 11 › Computer Science / Informatics Practices › Python programming fundamentals
Python fundamentals
Remember
- input() gives a str; convert with int() or float().
- / gives a float, // floors, % gives the remainder, ** is right-associative.
- Indentation marks blocks; range(a, b) stops before b; def makes functions.
Quick self-check
Output of print(type(3.0))?
Check
<class 'float'>.
What does range(5) produce?
Check
0, 1, 2, 3, 4.