Python program to take two integers from the user and determine and print whether the first is a multiple of the second.

Here is the code for the python program to take two integers from the user and determine and print whether the first is a multiple of the second.

# Python program to take two integers from the user and determines and prints whether the first is a multiple of the second.

firstNumber = int(input("Enter first number: "))
secondNumber = int(input("Enter second number: "))
if firstNumber % secondNumber == 0:
    print(firstNumber, "is multiple of", secondNumber)
else:
    print(firstNumber, "is not multiple of", secondNumber)

# This code is contributed by Ahmad Shafiq
callout-flag

Love this read? Subscribe to Modernage!

Do you have any queries? You can ask in the comments. We, at Modernage answer each and every question, asked in the comments, so If you have any queries, or you want to know about any specific platform you can ask in the comments below

Author

This Post Has One Comment

  1. mary

    Design a function called compare_median_average that takes as arguments three floating point numbers. The function should calculate the average and median of these numbers and print the following:

    If the median is more than 0.01 bigger than the average, it should print:

    the median is X higher than the average
    where X is the amount higher the median is than the average to two decimal places.

    If the median is more than 0.01 smaller than the average, it should print:

    the median is X smaller than the average
    where X is the amount smaller the median is than the average to two decimal places.

    Otherwise it should print:

    the median and average are approximately the same

Leave a Reply

girl-carrying-document

More Articles.

girl-carrying-document

More Articles.