Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How do I solve this problem? The program changes the variables to see if the line of code will work if either odd or even

How do I solve this problem? The program changes the variables to see if the line of code will work if either odd or even numbers are used.

image text in transcribed

Notice how on the left hand it tested with two different variables for mystery_int_1 = 7 and mystery_int_2 = 2 and my code didn't work.

[Executed at: Wed Feb 2 4:09:1 5 PST 2022] 1 mystery_int_1 = 15 2 mystery_int_2 = 5 3 4 #You may modify the lines of code above, but don't move them! 5 #When you Submit your code, we'11 change these lines to 6 #assign different values to the variables. 8 #The variables below hold two integers, mystery_int 1 and 9 #mystery_int_2. Complete this program below such that it 10 #prints "Factons!if either of the numbers is a factor of 11 the other. If neither number is a factor of the other, 12 #do not print anything. 13 14 Hint: You can do this with just one conditional statement 15 #by using the logical expressions we learned earlier (and, 16 #or, and not). You'11 also use the modulus operator we 17 #learned in Chapter 2.4. 18 we found a few things wrong wi th your code. The first one is shown below, and the rest can be found in full_results.txt i n the dropdown in the top lef We tested your code with myste ry_int_1 = 7, mystery_int_2 = 2. We expected your code to pr int this: However, it printed this: 20 =Add your code here! 21 Factors = mystery_int_1 % mystery_int_2 22 if mystery_int_1 or mystery_int_2 == Factors: 23 printFactors!") 24 else: 25 print) Factors

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle RMAN For Absolute Beginners

Authors: Darl Kuhn

1st Edition

1484207637, 9781484207635

More Books