Professional Documents
Culture Documents
Hi
Hi
Hi
```python
# run: true
a=4
b=5
print(a*b)
```
```python
a=4
b=5
print(a+b)
```
-
- `/` used for division of variables
```python
a=4
b=5
print(a/b)
```
```python
a=4
b=5
print(a-b)
```
```python
dividend = 10
divisor = 3
result1 = dividend // divisor
print("Floor division of two integers:", result1) # Output: 3
```
```python
name = "John"
age = 80
print("%s is %d years old" % (name, age)) # Output: "John is 80 years old"
```
- double-quotes = `"`
- used for initializing strings
```python
# this is an example for different kinds of string initialization
first = "Hello"
second = 'World'
third = """
hello
world
"""
print(f"first {first}, second {second} third {third}")
```
- **String**
- **function**
- **f-strings - formatted strings**
```python
# variable stored in memory when the python code
# assign total_days , 643
total_days = 643
x = 65 // 8
months = remaining_days // 30
remaining_days = (remaining_days % 30)
```
```python
#use**(1/2) for under root of amy given value
#use**(2) for square of amy given value
#and so on
```
```python
a=10
b=20
a+=b
print(a)
```
• Operator Subtraction(-=)
```python
a=10
b=20
a-=b
print(a)
```
```python
a=10
b=20
a*=b
print(a)
```
```python
a=10
b=20
a/=b
print(a)
```
Relational operators are used to compare the operand values on either side.
- Lesser than
```python
d=20
z=80
g=d>z
print(g)
- Greater than
```python
a=10
b=5
c=a>b
print(c)
```python
x = 5
y = 3
print(x >= y)
```
```python
x = 5
y = 3
print(x <= y)
```