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
cestrela7 [59]
3 years ago
15

Write a python program that contains a main function and a custom, void function named show_larger that takes two random integer

s 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.
Computers and Technology
1 answer:
sladkih [1.3K]3 years ago
4 0
Def show_larger(n1,n2):
if n1>n2:
print(str(n1)+" is larger than "+str(n2)+" by "+str(n1-n2))
elif n2>n1:
print(str(n2)+" is larger than "+str(n1)+" by "+str(n2-n1))
else:
print(str(n2)+" is same as "+str(n1))
import random
def main():
n1 = random.randint(1, 5)
n2 = random.randint(1, 5)
show_larger(n1,n2)

main()
You might be interested in
A web designer calls to report that the web server web-s1.cisco is not reachable through a web browser. The technician uses comm
Sergeeva-Olga [200]

Answer:

He can determine if the network is operational with a ping to the IP address.

If this fails, it means this is a DNS issue.

He can also determine if a router is down between the source and the server

Explanation:

A successful ping to IP address indicates that the network is working and the web server is online. Failure means that the host cannot resolve the associated domain name.

Try the web server at 192.168.0.10 is reachable from the source host. A router is down between the source host and the server web-s1.cisco.com. There is a problem with the web server software on web-s1.cisco.com

6 0
3 years ago
Under which condition below would you expect a glassy extrusive rock like obsidian to form?
agasfer [191]
Hihi!

The correct answer would be D. Quick cooling on Earth's surface! Obsidian is<span>a volcanic rock formed by the rapid solidification of lava without crystallization!

I hope I helped!
-Loliarual
</span>
7 0
4 years ago
Read 2 more answers
18) What is masking in Flash?
sammy [17]

Answer:

Ok thanks, I guess?

..............

6 0
3 years ago
Which type of transmission do modems use ?
horsena [70]
Asyncronous is the answer I think
6 0
3 years ago
Read 2 more answers
A security administrator is analyzing a user report in which the computer exhibits odd network-related outages. The administrato
elena-s [515]

Answer: Session Hijacking

Explanation:Session hijacking is the attacking activity that threats the valid session of the computer. This attack also invokes the system with unauthorized access for hacking the information and other processes.

Other options are incorrect because crpto-malware is the ransomware that demands ransom for data encrypted by the hackers, rootkit  permits the authorized access in system without getting noticed and logic bomb is a malicious code to harm the program computing. Thus, the correct option is session hijacking.

8 0
3 years ago
Other questions:
  • Define a function below, get_subset, which takes two arguments: a dictionary of strings (keys) to integers (values) and a list o
    8·1 answer
  • What is most likely kept in as database
    15·1 answer
  • PLEASE HELP I NEED RIGHT ANSWER!
    9·2 answers
  • Which of the following statements about creating arrays and initializing their elements is false?
    6·1 answer
  • What is cutting-edge technology
    6·1 answer
  • Many contemporary languages allow two kinds of comments: one in which delimiters are used on both ends (multiple-line comments),
    7·1 answer
  • Write a function that parses a binary number into a hex number. The function header is:def binaryToHex(binaryValue)Write a test
    11·1 answer
  • Write a program, TwoDimentionalGrid. Ask the user to enter the size of the 2 dimensional array. Here we are not doing any input
    13·1 answer
  • " Son Of Heaven" was a name given to
    5·1 answer
  • Which approach to bandwidth usage consumes all of the available frequencies on a medium to transmit data
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!