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
MA_775_DIABLO [31]
3 years ago
14

write an algorithm that reads two values determines the largest value and prints the largest value with an identifying message i

n Python​
Computers and Technology
1 answer:
Greeley [361]3 years ago
8 0

Answer:

a = int(input("Input your first number: "))

b = int(input("Input your second number: "))  

maximum = max(a, b)

print("The largest value: ", maximum)

Explanation:

The function max() can be used to find the maximum of two values

You might be interested in
Please help, I can't find the answer but I understand the topic.
gladu [14]

Answer:

x=(2+3)*3;

Explanation:

3 0
3 years ago
Read 2 more answers
Write a python program to read four numbers (representing the four octets of an IP) and print the next five IP addresses. Be sur
sdas [7]

Answer:

first_octet = int(input("Enter the first octet: "))

second_octet = int(input("Enter the second octet: "))

third_octet = int(input("Enter the third octet: "))

forth_octet = int(input("Enter the forth octet: "))

octet_start = forth_octet + 1

octet_end = forth_octet + 6

if (1 <= first_octet <= 255) and (0 <= second_octet <= 255) and (0 <= third_octet <= 255) and (0 <= forth_octet <= 255):

   for ip in range(octet_start, octet_end):

       forth_octet = forth_octet + 1

       if forth_octet > 255:

           forth_octet = (forth_octet % 255) - 1

           third_octet = third_octet + 1

           if third_octet > 255:

               third_octet = (third_octet % 255) - 1

               second_octet = second_octet + 1

               if second_octet > 255:

                   second_octet = (second_octet % 255) - 1

                   first_octet = first_octet + 1

                   if first_octet > 255:

                       print("No more available IP!")

                       break

       print(str(first_octet) + "." + str(second_octet) + "." + str(third_octet) + "." + str(forth_octet))

else:

   print("Invalid input!")

Explanation:

- Ask the user for the octets

- Initialize the start and end points of the loop, since we will be printing next 5 IP range is set accordingly

- Check if the octets meet the restrictions

- Inside the loop, increase the forth octet by 1 on each iteration

- Check if octets reach the limit - 255, if they are greater than 255, calculate the mod and subtract 1. Then increase the previous octet by 1.

For example, if the input is: 1. 1. 20. 255, next ones will be:

1. 1. 21. 0

1. 1. 21. 1

1. 1. 21. 2

1. 1. 21. 3

1. 1. 21. 4

There is an exception for the first octet, if it reaches 255 and others also reach 255, this means there are no IP available.

- Print the result

8 0
3 years ago
What happens to the Menu Bar when the<br> object (image, shape, etc.) is "active"?
nexus9112 [7]

Answer: Ok so Sorry about this but I will answer thing at 10:20 tommorow I promise

Explanation:

5 0
3 years ago
How do you change your name on this website?
Dominik [7]

Answer:

Well you mean app and yo look at the bottom of your screen and there is 3 icons and press the one that says me then press edit and thats how u do it

4 0
3 years ago
Read 2 more answers
What is a formula? What is a function? (In the context of Excel)
mel-nik [20]

Answer: A formula is an expression which calculate the value of a cell .A funcation is a predefined formula that performs calculations using specific values in particular order.According to context of excel.

4 0
4 years ago
Other questions:
  • Default tab stops are set in Word every _______ inch.<br> a. ¾<br> b. 1<br> c. ½<br> d. ¼
    13·1 answer
  • WHAT IS SQL AND HOW CAN YOU MEET THE DATA REQUIREMENTS ALSO MAINTAINING DATA INTEGRITY,AND LASTLY STATE THE FULL MEANING OF SQL
    11·1 answer
  • Is anyone else experiencing the wording::nonifacation::glitch about the "5 hours ago" thingy to whenever you answer a question o
    7·2 answers
  • What is the printout of the call nPrint("a", 4)?
    14·1 answer
  • Write a definition of the function printDottedLine, which has no parameters and doesn't return anything. The function prints to
    14·1 answer
  • Problem 2 Write a method that (a) returns an int[] , (b) takes in two sorted arrays (in descending order) and (c) returns an int
    13·1 answer
  • Create a text file named employee.dat containing the following data: b. Write a C++ program to read the employee.dat file create
    6·1 answer
  • What is the nearest ten cents of 453.56
    5·1 answer
  • Hellpppppppppppppppp
    13·2 answers
  • Design a circuit that will tell whether a given month has 30 days in it.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!