Assignment Opertators On Values
Assignment Opertators On Values
# SyntaxError:invalid syntax
#Reserved Keywords
>>> if = ‘Edwin’
1. Expression
>>> myname
‘Edwin’
>>> print(line01)
>>> print(line02)
>>> print(line03)
>>> print(line02)
>>> print(line01)
3. Assignment Operators
Step 1: Open New Terminal (Ctrl + ~)
>>> name
‘Edwin’
>>> Day
100
#Arithmatic Calculator
>>> 4 + 4 #Addition
>>> 4 – 2 #Subtraction
>>> 4 * 4 #Multiplication
16
>>> 50 / 4 #Division
12.8
12
13
>>> 48 % 5 #Percentage
>>> 2 ** 3 #Exponents
>>> 2 ** 5
32
>>> Day
53
>>> Day
52
>>> Day
520
>>> Day /= 10
>>> Day
>>> round(Day)
52
>>> Day
52.0
>>> Day
52
‘Edwin TS’
… Clear Terminal
False
>>> 46 == 46
True
>>> 46 != 46
False
>>> 47 != 46
True
>>> 10 > 5
True
>>> 10 < 5
False
>>> 10 >= 10
True
>>> 10 <= 10
True
>>> y = False
>>> z = True
>>> not y
True
>>> not z
False
False
>>> y and x
False
True
>>> y or x
True
True
>>> z and y
False
>>> y or z
True
>>> z or y
True
2 print('')
5 print('True')
6 else:
7 print('False')
Output: True
9 day = 9
10 print('')
11
13 print('True')
14 else:
15 print('False')
Output: False
# To run it from the Terminal Window
>>> py day.py
# To highlight All the codes as # (HashTag) comments --------- Select the script + ctrl + /
# Ternary Operator
17 print('True') if day > 10 else print('False')