Professional Documents
Culture Documents
Python Session 18
Python Session 18
Python Session 18
Python
Session 18
Create a list
This week’s topics:
1.Lists
2.More conditionals (if statements)
Let’s say I want to make a piece of code that converts from a numerical
grade (1-100) to a letter grade (A, B, C, D, F).
x = range(2, 11)
for elem in x:
print elem
List Compare
1.Randomly generate two lists to test this
•if a == 3:
• print("the variable has the value 3")
•elif a != 3:
• print("the variable does not have the value 3")
•if a == 3:
• print("the variable has the value 3")
•else:
• print("the variable does not have the value 3")
THANK YOU