Part 6 | Python Programming | Creating an if else statement using lists

Veröffentlicht am: 01 Januar 2023
auf dem Kanal: oOSylarTechOo
130
3

This is part 6 of a series of python coding that I am having fun with and want to show others that are interested or stuck.

Code Example:

#creating an if else statement using lists

#first, create your list
oddNumbers = [1, 3, 5, 7, 9]

#add your input to a variable
cNum = int(input("Choose a number from 1 to 10 "))

#Place a colon at the end of each if and else line
#Then indent your line following each if and else line

if cNum in oddNumbers:
print("True")
else:
print("False")

#python #pythonprogramming #pythontutorial #pythonforbeginners #shorts

Music: Pad Subscription with Wondershare Filmora


Auf dieser Seite können Sie das Online-Video Part 6 | Python Programming | Creating an if else statement using lists mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer oOSylarTechOo 01 Januar 2023 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 130 Mal angesehen und es wurde von 3 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!