Student Activity
Student Activity Guide:
1) Conditional Statements (if, elif, else)
num = int(input("Enter a number: "))
if num > 0:
print("Positive number")
elif num < 0:
print("Negative number")
else:
print("Zero")2) Looping Constructs (for, while)
# For loop example
for i in range(1, 11):
print(i)
# While loop example
while True:
user_input = input("Type 'exit' to stop: ")
if user_input.lower() == "exit":
break3) Iterators and range Function
4) Nested Loops and Loop Control Statements (break, continue, pass)
Student Exercises:
Last updated