subject

Write a program that contains a main function and a custom, void function named show_larger that takes two random integers as parameters. This function should display which integer is larger and by how much. The difference must be expressed as a positive number if the random integers differ. If the random integers are the same, show_larger should handle that, too. See example outputs. In the main function, generate two random integers both in the range from 1 to 5 inclusive, and call show_larger with the integers as arguments.

Answers

ansver
Answer from: timijebs

A program that contains a main function and a custom, void function named show_larger that takes two random integers as parameters.

Explanation:

The difference must be expressed as a positive number if the random integers differ. If the random integers are the same, show_larger should handle that, too. See example outputs.

def main():

value_1=random.randrange(1,6)

value_2=random.rangrange(1,6)

def show_larger():    

difference= value_1=-value_2

if value_1 == value_2:

   print('The integers are equal, both are' + str(value_1))

ansver
Answer from: Quest

pages of a boo

ansver
Answer from: Quest

what is your question exactly? when you let me know i will gladly you. : )

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 08:00, ionmjnm3041
The managing director of a company sends a christmas greeting to all his employees through the company email. which type of network does he use? he uses an .
Answers: 3
image
Computers and Technology, 23.06.2019 08:00, seaotter7140
Michael has written an e-mail to his employees that describes a new product special that will be introduced to the customers next week. by taking time to make sure the e-mail is well written, logical, and organized, michael has made sure his message has the characteristics of a) effective communicationb) ineffective communicationc) barriers to communicationd) workplace communication
Answers: 2
image
Computers and Technology, 23.06.2019 08:00, Buddy01
Match the items with their respective descriptions.
Answers: 1
image
Computers and Technology, 23.06.2019 08:00, hernandez09297
What is a scenario where records stored in a computer frequently need to be checked
Answers: 2
You know the right answer?
Write a program that contains a main function and a custom, void function named show_larger that tak...

Questions in other subjects: