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
Basile [38]
4 years ago
14

Two variables named largest and smallest are assigned for you. Use these variables to store the largest and smallest of the thre

e integer values. You must decide what other variables you will need and initialize them if appropriate.
Write the rest of the program using assignment statements, ifstatements, or elif statements as appropriate. There are comments in the code that tell you where you should write your statements. The output statements are written for you.

Execute the program. Your output should be:

The largest value is 78
The smallest value is -50
# LargeSmall.py - This program calculates the largest and smallest of three integer values.
# Declare and initialize variables here
firstNumber = -50;
secondNumber = 53;
thirdNumber = 78;

# Write assignment, if, or if else statements here as appropriate

# Output largest and smallest number.
print("The largest value is " + str(largest))
print("The smallest value is " + str(smallest))

Computers and Technology
1 answer:
Svetlanka [38]4 years ago
7 0

Answer:

# LargeSmall.py - This program calculates the largest and smallest of three integer values.

# Declare and initialize variables here

firstNumber = -50;

secondNumber = 53;

thirdNumber = 78;

# Write assignment, if, or if else statements here as appropriate

#Finding the Largest

if firstNumber>secondNumber and firstNumber>thirdNumber:

   largest = firstNumber

elif secondNumber>firstNumber and secondNumber>thirdNumber:

   largest = secondNumber

else:

   largest = thirdNumber

#Finding the smallest

if firstNumber<secondNumber and firstNumber<thirdNumber:

   smallest = firstNumber

elif secondNumber<firstNumber and secondNumber<thirdNumber:

   smallest = secondNumber

else:

   smallest = thirdNumber

# Output largest and smallest number.

print("The largest value is " + str(largest))

print("The smallest value is " + str(smallest))

Explanation:

Given that Most part of the code has already being written using python programming language. Our task was to add the necessary if and else statements that will check the three numbers and return the largest and smallest among them. Check the attached screenshoot for the program output, also read the comments made in  the code

You might be interested in
Brenda wants to finish her presentation with a summary slide . She wants three key messages to appear on each of the photo clips
Sav [38]

Brenda can first include an image and then include text. Lastly she can just provide an enhanced effect to the text to appear one by one each photo clip.

4 0
3 years ago
Read 2 more answers
I'm trying to network two laptops together using ethernet cable but it isn't working. Why isn't it working
Nonamiya [84]

On modern network cards, this should just work.

It is advisable to give each laptop its own fixed IP address, such as 192.168.1.1 and 192.168.1.2 (with a netmask of 255.255.255.0)

However, you need to define what you expect to work. The first thing to try is ping <em>the other</em> machine from the command prompt, e.g.:

C:\> ping 192.168.1.2

Then, you can try to access shared network drives if you have enabled that. In the file explorer, try typing: \\192.168.1.2

5 0
4 years ago
Error messages begin with the ____ symbol.
Zarrin [17]
Error messages begin with the # (hashtag) symbol.
8 0
3 years ago
Read 2 more answers
Please helpppppppppppppppppp please I’m stuck!
Vinvika [58]

do u know thw muffin man

3 0
3 years ago
Which key(s) will launch the Spelling Checker dialog box? F8 F7 Ctrl+H F2
KIM [24]

Answer:

F7

Explanation:

Mostly in MS Office products, although a lot of other products will mimic the same well known key sequences as a way of enticing you to their platform.

6 0
3 years ago
Read 2 more answers
Other questions:
  • 1. Mobile devices have a _________ viewport that displays a web page content that fits within a mobile screen.
    11·1 answer
  • What kind of java program runs within a java-enabled browser?
    15·1 answer
  • What cell phone technology is the most popular in the united states?
    8·2 answers
  • Can someone help me to give this guy brainliest the button is not there
    8·1 answer
  • Can somebody help me with this please
    6·2 answers
  • Write a method named removeRange that accepts an ArrayList of integers and two integer values min and max as parameters and remo
    10·1 answer
  • What happens when you apply a theme to a form?
    14·1 answer
  • Most C++ catastrophe vulnerabilities rely on uninitialized function pointers in a class.
    13·1 answer
  • What do you think entertainment or gaming platforms will look like in the future?
    9·1 answer
  • Can a dod activity enter into a service contract for a military flight simulator without getting a waiver from the secretary of
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!