Python Made Easy for AI - Day 2

December 16, 2022
# Start Here test_object("a") test_function("print") success_msg("Great job!")
Use the assignment operator (<-) to create the variable a.


Conditionals

Excercise - 1:

On a coin toss if it's Heads: India Bat's, If it's tails: Australia Bats

Toss = "Heads"

if Toss == "Heads":
    print ("India's Batting")
else:
    print ("Australia's Batting")

Excercise - 2:


Logic of Traffic Signals:

signal = "green"

if signal == "green":
   print ("Go")


Excercise - 3:

#90 or higher should get an “A”
#65 - 89 should get a “B”
#Anything below a 65 should receive an “F”

if _____:
       return "A"
elif _____:
       return "B"
else:
       return "F"

Related Posts