isRaining = False
result = not(isRaining)
print(result)
True
grade = 75

# Has to be between 70 and 100

if grade > 70 and grade <= 100:
    print("You passed the quiz")
You passed the quiz

Logical Operator

  • A logical operator is a symbol or word used to connect two or more expressions Selection
  • The specific block of code that will execute depending on the algorithm condition returning true or false. Algorithm
  • A specific task that is completed with the use of instructions Conditional Statement / If-Statement:
  • A statement that affects the sequence of control by executing certain statements depending on the value of a boolean (true or false).
SoccerMinutesPlayed = 48

if SoccerMinutesPlayed > 40:
    print("you played over half the soccer game, congradulations!")
else:
    print("You need to train more")

# Adding another variation to the hack
you played over half the soccer game, congradulations!
import random

a_list = [27, 32, 96,]
random.shuffle(a_list)

a_list[0]

if a_list == 27:
    print(result)
else:
    print('your number is not 27')

# If statement
your number is not 27
import random
a=random.randint(1,100)
print(a)
44