# Python Lab 2 # Write the code to answer each question and print the answer def place_of_birth(): # print the string containing your birth location birth_location = raw_input("Enter your place of birth as city, state, country: ") # Split your birth location and print out the city, state, country on separate lines def month_of_birth(): # Print the month you were born by finding the appropriate substring in months # Hint use the variable pos to find the start of your birth month in months months = "JanFebMarAprMayJunJulAugSepOctNovDec" bday_month = eval(raw_input("Enter the number of your birthday month: ")) pos = (bday_month - 1) * 3 def first_school(): # print the string containing the first school you went to school = raw_input("Enter the name of the first school you went to: ") # print on separate lines the first school you went to in all upper case letters, # then all lower case letters, # then with each word capitalized def favorite_color(): # Determine if your favorite color is in the color_list # If your favorite color is in the color_list, print the color and that it is in list # If your favorite color is not in the color_list, replace color with your favorite color # and print out the new color_list. Use an if, else statement color_list = "red, blue, yellow, green, purple, color" favorite =raw_input("Enter your favorite color: ") def my_function(): # define your own function using strings and string operations print "This is my new function" place_of_birth() month_of_birth() first_school() favorite_color()