“Python Logical Operators Code” Code-Antworten

Python -Operatoren

# --------------------------
# -- Arithmetic Operators --
# --------------------------
# [+] Addition
# [-] Subtraction
# [*] Multiplication
# [/] Division
# [%] Modulus
# [**] Exponent
# [//] Floor Division
# --------------------------

# Addition

print(10 + 30)  # 40
print(-10 + 20)  # 10
print(1 + 2.66)  # 3.66
print(1.2 + 1.2)  # 2.4

# Subtraction

print(60 - 30)  # 30
print(-30 - 20)  # -50
print(-30 - -20)  # -10
print(5.66 - 3.44)  # 2.22

# Multiplication

print(10 * 3)  # 30
print(5 + 10 * 100)  # 1005
print((5 + 10) * 100)  # 1500

# Division

print(100 / 20)  # 5.0
print(int(100 / 20))  # 5

# Modulus

print(8 % 2)  # 0
print(9 % 2)  # 1
print(20 % 5)  # 0
print(22 % 5)  # 2

# Exponent

print(2 ** 5)  # 32
print(2 * 2 * 2 * 2 * 2)  # 32
print(5 ** 4)  # 625
print(5 * 5 * 5 * 5)  # 625

# Floor Division

print(100 // 20)  # 5
print(119 // 20)  # 5
print(120 // 20)  # 6
print(140 // 20)  # 7
print(142 // 20)  # 7
Helpful Horse

Python Logical Operators Code

children_above_five= True
have_good_health= True
if children_above_five and have_good_health:
    print("Eligible to get admission in Primary school.")
children_above_five= True
have_good_health= False
if children_above_five or have_good_health:
    print("Eligible to get admission in Primary school.")
children_above_five= True
have_good_health= False
if children_above_five and not have_good_health:
    print("Eligible to get admission in Primary school.")
MD. SHARIFUL ISLAM

Ähnliche Antworten wie “Python Logical Operators Code”

Fragen ähnlich wie “Python Logical Operators Code”

Weitere verwandte Antworten zu “Python Logical Operators Code” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen