1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
algol13
3 years ago
8

Write a program that contains a main function and a custom, void function named show_larger that takes two random integers as pa

rameters. 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.
Computers and Technology
1 answer:
melisa1 [442]3 years ago
8 0

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))

You might be interested in
If you want to present slides to fellow students or co-workers, which productivity software should you use to create them?
slamgirl [31]
Microsoft powerpoint? i think thats what this is asking
4 0
3 years ago
Read 2 more answers
See the file attached!​
Dimas [21]
  1. Mail Merge is a handy feature that incorporates data from both Microsoft Word and Microsoft Excel and allows you to create multiple documents at once, such as letters, saving you the time and effort of retyping the same letter over and over.
  2. The Mail Merge feature makes it easy to send the same letter to a large number of people.
  3. By using Mail Merge, we don't have to type each recipient's name separately in each letter.
  4. We need to proofread only the main document network database systems object- oriented database system Hierarchical database system.
6 0
2 years ago
What is Selection statement?​
Sati [7]

Answer:

Selection statements (sometimes called conditional statements) can be defined as code (statements) that is executed only when a certain condition is satisfied.Selection is a powerful tool to control when and which code statements will run.

3 0
3 years ago
Read 2 more answers
What is the name of the variable in this code?
nata0808 [166]

Answer:

fav_color

Explanation:

4 0
3 years ago
Read 2 more answers
Ok i dont wanna get bannddddddd so i have to ask a qustion<br> 2 plus 2
Evgesh-ka [11]

Answer:

22 or 4

Explanation:

:)

3 0
3 years ago
Read 2 more answers
Other questions:
  • This assignment is to read from an input file and process the data for a group of people. Your program calculates the interest a
    5·1 answer
  • Why should you delete files from your computer? (multiple answers can be chosen)
    5·2 answers
  • zeroIt is a function that takes one argument and returns no value. The function stores the value 0 back into the parameter. x is
    8·1 answer
  • Which categories format cells
    14·2 answers
  • A writing team wants to present the six-month sales figures for its company's 14 sales representatives in a report. Because mana
    11·1 answer
  • Write a function definition for a function which takes one parameter and returns twice that parameter
    12·1 answer
  • What mistake might you make related to changing the data in a cell that's used in a formula?
    14·1 answer
  • Where in PowerPoint should a user navigate to complete the tasks listed below?
    6·1 answer
  • Does anyone have 2.19.4 Guess a number 2.0 code for codehs?
    8·1 answer
  • Does anyone know 7.1.3: Firework karel?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!