Python_Hands_On_Exercises
Python_Hands_On_Exercises
Compile
1. Try writing a simple Python script and execute it using the command line.
2. Use the py_compile module to compile a Python script to a .pyc file.
Portable
High Level
1. Write a Python program that dynamically allocates memory (e.g., using a list).
2. Compare memory management in Python with C using a simple example.
print()
Variables
1. Create variables of different types and print their values and types.
2. Swap two variables without using a third variable.
Indentation
Reserved Keywords
1. Try using a Python keyword as a variable name and observe the error.
2. Use the 'keyword' module to list all Python reserved keywords.
Data Types
Comments in Python
Arithmetic Operators
Input in Python