There are 3 syntax errors in the following code. Fix it to print correctly without errors. It will print, βHer name is Molly and her favorite food is tuna.β
There are 3 syntax errors in the following code. Fix it to print correctly without errors. It will print, βHer name is Molly and her favorite food is tuna.β
Many people keep time using a 24 hour clock (11 is 11am and 23 is 11pm, 0 is midnight). If it is currently 13 and you set your alarm to go off in 50 hours, it will be 15 (3pm). Write a Python program to solve the general version of the above problem. Ask the user for the time now (in hours), and then ask for the number of hours to wait for the alarm. Your program should output what the time will be on the clock when the alarm goes off. Using the int() function and modulus operator % could come in handy!
Store the current time in a variable called current_time, the number of hours to wait in a variable called waiting_time, the sum of the current time and waiting time in a variable called hours, and the resulting alarm time in a variable called time_of_day, as shown in the starter code.
Many people keep time using a 24 hour clock (11 is 11am and 23 is 11pm, 0 is midnight). If it is currently 13 and you set your alarm to go off in 50 hours, it will be 15 (3pm). Write a Python program to solve the general version of the above problem. Ask the user for the time now (in hours), and then ask for the number of hours to wait for the alarm. Your program should output what the time will be on the clock when the alarm goes off. Using the int() function and modulus operator % could come in handy!
Assume that you have 24 slices of pizza and 7 people that are going to share it. Thereβs been some arguments among your friends, so youβve decided to only give people whole slices. Your pet dog Andy loves pizza. Write a Python expression with the modulus operator that calculates how many pizza slices will be left over for your dog after serving just whole slices to 7 people. Assign the result of that expression to forAndy.
Write a program that will convert a user entered number of inches to feet. Reminder: there are 12 inches in a foot. Store the number of inches entered by the user in a variable called inches, and store the result in a variable called feet and print it.
Write a program that will convert a user entered number of feet to inches. Reminder: there are 12 inches in a foot. Store the number of feet entered by the user in a variable called feet, and store the result in a variable called inches and print it.
Write code below to get at least 3 values from the user using the input function and output a mad lib (which will use the input to tell a silly story).