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
lana [24]
3 years ago
7

write a program to input 3 numbers and print the largest and the smallest number without using if else statement​

Computers and Technology
1 answer:
klemol [59]3 years ago
8 0

Answer:

def main():

   # input

   num1 = int(input("Type in a number: "))

   num2 = int(input("Type in another number: "))

   num3 = int(input("Type in another number: "))

   list1 = [num1, num2, num3]

   # sorts the array

   list1.sort()

   # list1[-1] prints the first element in the array

   print("The largest number is: " + str(list1[-1]))

   # -len(list1) takes the length of the list, in this case 3, and makes it a negative number.  

   # That negative number is then used as an index for the list1 array in order to print the lowest number.

   print("The smallest number is: " + str(list1[-len(list1)]))

main()

Explanation:

Hope this helped :) I left some comments so you know what's going on. You can also use max(list1) and min(list1) but I chose indexing because indexing is the better way of doing stuff like this.

Have a good day!

You might be interested in
Explain a business scenario where management information systems plays a part.
Leokris [45]

Answer:

In this article, we'll cover what is happening with MIS in both business and ... is when you're notified or your credit card is frozen, depending on the situation.

Explanation:

3 0
3 years ago
Your classmate is frustrated because the code that was designed to add up her five quiz grades is not working properly.
inna [77]

Answer:

sum = 0 must be before for loop. If inside for loop, it will keep resetting sum to 0 each iteration.

Explanation:

hope this helps

7 0
3 years ago
Ou have an application running on Oracle Cloud Infrastructure. You identified that the read and write operations are slowing you
Otrada [13]

Answer:

Options A and C.

Explanation:

In Oracle Cloud Infrastructure the two options which allows you to increase disk performance are;

1. Terminate the compute instance preserving the boot volume. Create a new compute instance using a VM Dense IO shape using the boot volume preserved.

2. Create a backup of the boot volume. Create a new compute instance a VM Dense IO shape and restore the backup.

3 0
3 years ago
question 2 what are some types of software that you'd want to have an explicit application policy for? check all that apply.
zaharov [31]

The types of software that you'd want to have an explicit application policy are:

  • Filesharing software
  • video games

  • Explicit application policy are simply refered to as legal rights that are stated regarding ownership or company. It is actual substance of an agreement

  • Video games and filesharing software is of not really important in som business. So therefore, having explicit policies showing why or not this type of software is permitted on systems is okay.

Conclusively, we can say that Filesharing software and video games can require an explicit application policy.

Learn more from

brainly.com/question/12730075

4 0
3 years ago
Write a computer program that computes the duration of a projectile’s flight and its height above the ground when it reaches the
Citrus2011 [14]

Answer:

#include <stdio.h> #define Gray 32.17 /* gravitational constant */ #include <math.h> /*cos definition*/ #define PI 3.14159265

int main(void) double Theta; /*input-angle(radians)of elevation*/ double Distance; /*input-distance (ft) to target */ double Velocity; /*input-projectile velocity (ft/sec)*/ double Time; /* output-time(sec) of flight*/ double Height; /*output-height at impact*/

printf("Enter Distance> "); scanf("%f", &Distance);

printf("Enter Radians> "); scanf("%f", &Theta);

printf("Enter Velocity> "); scanf("%f", &Velocity

Time = Distance / (Velocity * cos(Theta*PI/180.0) ) ;

Height = (Velocity *sin(Theta*PI/180.0)*Time) - Grav*(Time* Time) );

printf("The time of flight is %.3f seconds.\n", Time); printf("The height at impact is %.3f feets.\n", Height);

system("pause");

return (0);

7 0
3 years ago
Other questions:
  • What advantage does a reliable web page have over published textbooks and encyclopedias?
    15·2 answers
  • A. STOP: What is a technology habit you practice today that you now realize will not help you to be successful? Explain why it’s
    10·2 answers
  • Because an AVL tree is a binary search tree, the search algorithm for an AVL tree is the same as the search algorithm for a bina
    10·1 answer
  • What form of internet access currently uses a technology called 4gb?
    10·1 answer
  • When would an absolute cell reference be most helpful?
    12·2 answers
  • What is an LMS and how is it used?
    8·1 answer
  • Which of the following illustrations is depicted in the icon that's used to access Windows Help and Support files?
    13·1 answer
  • Suppose you begin with an empty binary search tree, and want to add all the positive integers from 1 through 31 to the tree. If
    5·1 answer
  • Historically, storytelling passed down the most important ideas about life, family, and society from generation to generation; t
    10·2 answers
  • My chrome book computer clock is an hour off how do I fix that
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!