Introduction to Python Programming
� Getting Started with Python: Concepts, Syntax, and Execution
Presented by:�Mr. Atul Kalukhe
Introduction to Python
History of Python Programming
Why Do We Need Python Programming?
Real-World Applications of Python
Fundamentals of Python Programming
Dynamically Typed:� Variables do not require explicit type declaration. The data type is inferred during runtime.��x = 10 # Integer
x = "Hi" # Now a string
Code Example:
print("Welcome to Python Programming!")
Using the Python REPL (Interactive Shell)
REPL Example:��>>> 2 + 3
5
>>> print("Hello!")
Hello!
>>> name = input("Enter your name: ")
Enter your name: Alice
>>> print("Welcome", name)
Welcome Alice
How to Run Python Scripts
Navigate to the folder where the .py file is saved.��cd path/to/your/folder
Run the script using:�python example.py or��python3 example.py
Code Example (greet.py):
name = input("Enter your name: ")
print("Hello", name)
Variables and Assignment in Python
Examples:
x = 10 # Integer variable
name = "Alice" # String variable
price = 99.99 # Float variable
is_valid = True # Boolean variable
a, b, c = 1, 2, 3
x = 5
x = "Hello" # Now x holds a string
Python Keywords
How to See Keywords in Python:�� python�CopyEdit�import keyword
print(keyword.kwlist)
Input and Output in Python
Examples:
print("Hello, World!") # Print a string
name = "Alice"
print("Welcome", name) # Print multiple items
print(f"Hello, {name}!") # Using f-string for formatting
Example:
age = input("Enter your age: ") # User enters input
print("Your age is", age)
Example:
num = int(input("Enter a number: "))
print("Number plus 10 is", num + 10)
Indentation in Python
if True:
print("This line is indented")
print("So is this line")
print("This line is outside the if block")