Python Basics
Python Basics
To Start:
On windows:
To End:
2 Modes:
1. Interactive Mode
2. Script Mode
1. Interactive Mode:
Example:
>>> 5 + 3
This is called Interactive Mode because Python runs each line immediately as you type.
python example.py
name = "Varshini"
print("Hello,", name)
Output:
Hello, Varshini
Summary:
Interactive Mode: For quick testing.
Script Mode: For real projects and large programs.
Instead of typing everything in the terminal, you can write code in a file and run it.
print("Hello, Python!")
python hello.py
Output:
Hello, Python!