Python Introduction
1. Basic Data Types
- int – Integer numbers (10, 20)
- float – Decimal numbers (10.5, 20.5)
- str – String ("Hello")
- bool – Boolean values (True, False)
2. Functions
- A function is a reusable block of code.
-
defkeyword is used to create a function. - Parameters are used to pass values into a function.
-
returnis used to return a value from a function.
3. Loops
- for loop – Used to iterate over a sequence.
- while loop – Executes repeatedly as long as the condition is True.
Top comments (0)