Python Solutions Map

Easily find your questions below, and if you don't see it on here, then scroll to the bottom and let us know. We are actively adding new questions every day.

Suppose that the tuition for a university is $10,000 this year and increases 5% every year. In one year, the tuition will be $10,500. Write a program that displays the tuition in 10 years and the total cost of 4 years worth of tuition starting after the 10th year.

Using loops, write a program that finds the largest prime number smaller than 10,000

Write a program that takes the account’s present value, monthly interest rate, and the number of months that the money will be left in the account as three inputs from the user.

Write a Boolean function named is_prime which takes an integer as an argument and returns true if the argument is a prime number, or false otherwise. Use the function in a program that prompts the user to enter a number and then prints whether the number is prime.

Write an expression (not a statement!) whose value is the largest of population1, population2, population3, and population4 by calling max2.

Write an expression (not a statement!) whose value is the larger of population1 and population2 by calling max.

Define a function called min that takes two parameters containing integer values and returns the smaller integer of the two. If they have equal value, return either one.

Define a function called isSenior that takes a parameter containing an integer value and returns True if the parameter is greater than or equal to 65, and False otherwise

Define a function called signOf that takes a parameter containing an integer value and returns a 1 if the parameter is positive, 0 if the parameter is 0, and -1 if the parameter is negative

Write the definition of a function absoluteValue that receives a parameter containing an integer value and returns the absolute value of that parameter.


Missing a Question?

Do you have a question that isn't on my blog? Email it to me using the contact form below, and I will add it along with the answer as quickly as possible.