Question: Python: From user input of two large integers a and b : Part1- Part 2- Determine if a is greater than b and display an

Python: From user input of two large integers a and b :

Part1-

Python: From user input of two large integers a and b :

Part 2-

Part1- Part 2- Determine if a is greater than b and display

an appropriate message "a is greater than b" or "a is not

Determine if a is greater than b and display an appropriate message "a is greater than b" or "a is not greater than b", but with the actual values for a and b (ex: 1234 is not greater than 2345) Determine if a is even and display an appropriate message "a is even" or "a is not even", but with the actual value for a (ex: 1234 is even). Hint: there is an operator that you can use to determine this! Determine which variable is larger, a or b (don't print anything at this point...) Determine if the smaller one is a factor (divisor) of the larger one Display an appropriate message, "a is a factor of b" or "a is not a factor of b", but with the actual values for a and b (ex: 1234 is not a factor of 2345) Create a variable c o Ask the user for a small integer, not equal to 1, store it in c ("Enter a small numerical values not equal to 1:"). Don't bother checking that cb or that c != 1, you may assume that for this lab o Using a loop, print all of the numbers from c to b, counting up by c's (including cand b, if appropriate), separated by spaces, all on one line If c is 3 and bis 27, you should display: 3 6 9 12 15 18 21 24 27 if c is 4 and bis 18, you should display: 4 8 12 16 Hint: accomplish this without using any if statements! Consider the interesting ways to use the range() function.... o Using a loop, print all of the numbers from b to c, counting DOWN by c's (including c and b, if appropriate) if cis 3 and bis 27, you should display: 27 24 21 18 15 129 63 if c is 4 and bis 18, you should display: 18 14 10 6 Hint: accomplish this without using any if statements! Print an end of line at the end of all the numbers Using a loop, print all of the factors of a including land a itself. o Display an appropriate message "factors of a:" followed by the factors o Separate each factor by a comma and a space (ex: factors of a: 1, 2, 617, 1234) o Hint: how will you avoid printing a comma after the last factor? Can you do it without adding another lif' statement? Watch your Indentation!! Using this same loop, determine if a is a prime number (Hint: prime numbers have no factors other than land themselves! o Display an appropriate message "a is a prime number" or "a is not a prime number", but with the actual value for a (ex: 1234 is not a prime number)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!