new deva
new deva
PYTHON
Interpreted: -
The source code of a python program is converted into byte code that is
then executed by the python virtual machine.
(or)
1
History and evolution of PYTHON
Python was created by Guido van Rossum and first released in 1991. It
was designed to emphasize code readability and simplicity. Over the
years, Python has evolved through major versions:
Python 3.x: Current version with modern features and ongoing support.
4. Verify Installation:
print("Hello, World!")
In the terminal, navigate to the file's directory and type python hello.py.
2
Basic Syntax and Data Types
Variables and data types
Operators
Input and output
Example:
# Variable declaration
x = 10 # Integer
y = 3.14 # Float
Operators
a = 10
b=3
print(a + b) # Addition
print(a ** b) # Exponentiation
3
print(a == b) # False
x=5
x += 3 # x = x + 3
print(x) # 8
Example:
# Input
# Output formatting
age = 25
***************