I need help with my python assignment ...
`````````````````````````````````````````````````````````````````````````````````````````````
Create a program called Lab3B2 that will ask the user for two integers. The first number should be larger
than the second.
Write a while loop that will keep looping and asking the user to re-enter the numbers if the second
number is larger than the first.
After the while loop has finished, it should print “We have 10’s!” if any of the following things are true
• If either number is divisible by 10
• If their sum or their difference is divisible by 10.
If none of those things are true, it should print “No 10’s here.”



`````````````````````````````````````````````````````````````````````````````````````````````````````````````````````

Respuesta :

tonb

Answer:

while(True):

 num1 = int(input("Enter first number: "))

 num2 = int(input("Enter second number: "))

 if (num1 > num2): break

 print("First number has to be larger than the second number. Please try again.")

if (num1 % 10 == 0) or (num2 % 10 == 0) or ((num1+num2) % 10 == 0) or ((num1-num2) % 10 == 0):

 print("We have 10's!")

else:

 print("No 10’s here.")

Explanation:

The % 10 operation returns 0 if the number is divisible by 10.

ACCESS MORE