Lab: Practice Problems II

Conditional statements

Copy this into a Python file and add the specified code under each comment. For testing purposes, you can comment out working parts as you go (surround the lines with """).

"""
This is how you comment
out a whole block of stuff.
"""
# given the variable x with a number gotten from the user...
x = input("Number please: ")

# write python code to...

# print "Hello, 17, my old enemy" if the user typed in 17


# print "Hello you small, pathetic number" if the user typed a number less than 10


# print "Impressive" if the user typed a number greater than 100


# if the user typed a number between 70 and 80, print that number plus 5
# (note that an if can be nested in another if, just like for and any other statement)


# and finally...
# create a list containing 4 whole numbers (integers)


# copy it to another list using a loop, but add 4 to any even numbers


# copy it to another list using a loop, but omit any numbers less than 10