Back to Browse

03 Learn Python by real examples: Comments and if

50 views
Feb 3, 2021
8:10

This program checks if the sport the user enters is one of the three most popular sports in the world or not. football, cricket and hockey print("Popular sport checker!") sportName = input("Enter the sport name! ") if sportName == "football" or sportName == "cricket" or sportName == "hockey": print(sportName +" is one of the most popular sports in the world.") else: print(sportName +" is NOT one of the most popular sports in the world.")

Download

1 formats

Video Formats

360pmp49.6 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

03 Learn Python by real examples: Comments and if | NatokHD