Conditional statement thumbnail

Python conditional statements and loops

in this tutorial, I discuss how if…else statements are used to give programs the ability to make decisions in Python. They alter the course of program execution by allowing branching. I also discuss how computers are able to excel at boring and repetitive tasks through loops.

Correction: There is a slip of the tongue about an addition operation.

Nota Bene: The program about “parts_of_speech and words” was not created to match the members of the lists accurately. If you want to do that, modify the program thus:

parts_of_speech =['Noun', 'Adjective', 'Pronoun']

words = ['John', 'Intelligent', 'He']

n = 0

for x in parts_of_speech:
    y = words[n]
    print(x, y)
    n+=1

Please share this.

C. O. Daniel

C. O. Daniel holds degrees in Computer Science and certifications from CompTIA and Microsoft. His areas of interest include computer networking, data analysis, system administration and programming.

Leave a Reply