Python Forum

Full Version: Branching and Conditionals/If statements
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am currently doing a group of python assignments and I need help with completing them.

I am currently stuck on both of the problems listed below.If someone could quickly help me do them that would be greatly appreciated!

Ask the user to input a number. If the number is divisible by 2 print “even”. If it is divisible by 3 print “divisible by 3”. If it is divisible by 5, print “divisible by 5”. If it’s divisible by 10, print “divisible by 10”. If the number is divisible by more than one of these numbers, print only the highest number it is divisible by (ie. For number = 150, the program should print “divisible by 10”). If the number is not divisible by any number, print "not divisible by 2, 3,
5 or 10.


2.Allow the user to input two integers, a and b. Use branching to print True if either of the two numbers is equal to 5, or if the sum or difference of the numbers equals 5. Otherwise, print False.
we are glad to help with code that you have written.
We do not write code for you.