June 2024
Beginner to intermediate
908 pages
15h 59m
English
Write a Python program that prompts the user to enter 10 pairs of numbers and then counts and displays the number of times that the first user-provided number was greater than the second one and the number of times that the second one was greater than the first one.
Solution
The Python program is as follows. It uses variable countA to count the number of times that the first user-provided number was greater than the second one and variable countB to count the number of times that the second one was greater than the first one.
Read now
Unlock full access