+1 (315) 557-6473 

Different programs using Python Assignment Solution

User Name and Initial Printout Programming

Assignment 3

  1. Write a python assignment program that asks for the user’s full name and then prints their initials.
  2. Write a program that asks for the user’s birthday in the format of “MM/DD/YYY” and then prints the month they were born in letters. For instance, if the user enters: 01/01/1990, the code should print “January”. Also if the person was born after 1997, the code should print “You are Gen Z”.
  3. Write a program that keeps asking for the user’s favorite foods and stops when the user types “done”. Then if the user has entered “Pizza” as one of their favorite foods, it should print “You do not have a healthy diet”, otherwise it should print “You have a healthy diet”.
  4. Write a program that asks for the user’s opinion on the new iPhone. Define 2 lists of keywords for battery and camera. Then based on those keywords, your code should decide if the review is about battery, about the camera, about both, or about none of them.



def main(): name = input("Enter your full name: ") words = name.split(" ") for word in words: print(word[0].upper() + ".", end = " ") if __name__ == '__main__': main()


def main(): months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] date = input("Please enter your birthday in format (MM/DD/YYYY): ") ind = date.split("/") print(months[int(ind[0]) - 1]) if int(ind[2]) > 1997: print("You are Gen Z.") if __name__ == '__main__': main()


def main(): entry = "" output = "You have a healthy diet" while entry.lower() != "done": entry = input("Enter a food you like: ") if entry.lower() == "pizza": output = "You do not have a healthy diet" print(output) if __name__ == '__main__': main()


def main(): battery = ["battery", "large", "backup", "mah", "li", "lithium", "hours"] camera = ["camera", "sharp", "picture", "photo", "mega", "pixel", "zoom", "clarity"] review = input("Enter your opinion about iPhone: ") words = review.lower().split(" ") isBattery = False isCamera = False for word in words: if word in battery: isBattery = True elif word in camera: isCamera = True if isBattery and isCamera: print("Review is about both battery and camera") elif isBattery: print("Review is about battery") elif isCamera: print("Review is about camera") else: print("Review is neither about battery nor camera") if __name__ == '__main__': main()