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
vagabundo [1.1K]
2 years ago
15

Can someone pls help fix my code on Project stem. 2.7 Code Practice: Question 1 (Python no Java script)

Computers and Technology
1 answer:
Savatey [412]2 years ago
4 0

The required code which displays the largest of three user supplied integer values written in python is as follows :

num_1 = int(input())

#takes first integer input from user

num_2 = int(input())

#takes second integer input from user

num_3 = int(input())

#takes third integer input from user

def maximum(num_1, num_2, num_3):

#initiates a function named maximum which takes the three user defined inputs

largest = num_1

#sets num_1 as the largest

if (num_2 > num_1) and (num_2 >num_3):

#checks if num_2 is greater than the first and third input

largest = num_2

#if TRUE set the second input as the largest

elif (num_3 > num_1) and (num_3 > num_2):

#checks if num_3 is greater than the first and second input

largest = num_3

#if TRUE, set the third input as the largest

return largest

# return the largest value after evaluation.

print('Largest value is :' + str(maximum(num_1, num_2, num_3)))

#displays the maximum value of the three inputs.

The result of the code processed is attached in the picture below.

Learn more :brainly.com/question/14786286

You might be interested in
A list of the available non keyboard characters can be seen in windows by opening what utility
Leya [2.2K]
Character Map ... I hope This Helps
8 0
3 years ago
Each symbol of an octal number corresponds to 3 bits of a binary number. is it true or false​
grin007 [14]

Answer: True.

Explanation: It uses only the 3 bits to represent any digit in binary and easy to convert from octal to binary and then to vice-versa. Hope that helps

5 0
3 years ago
After merging two arrays is complete you need to
VikaD [51]

Answer: C) copy the merged array back to the original array

Explanation:

 After performing merging of two array then, copy the merge array back to its original array. Merging of two array is done by the process of merge sort. Merging of two array is the similar process of concatenate the two array into the single object.

It basically works on the principle of divide and conquer algorithm. It divide the input value into the two half and then, sorted the accordingly. Then after completion of merging the two array it copy into the original array.

5 0
3 years ago
Write a program that allows a user to choose to roll between 1 and 100 dice between 1 and 1000 times
s344n2d4d5 [400]

Answer:

Here is a Python program that allows a user to choose to roll between 1 and 100 dice between 1 and 1000 times. The program uses a while loop to continuously prompt the user for input until they enter a valid number of dice and rolls. It also uses a for loop to simulate the dice rolls and a random module to generate random numbers for the dice rolls.

import random

while True:

   # Prompt the user for the number of dice to roll

   num_dice = int(input("Enter the number of dice to roll (1-100): "))

   if num_dice < 1 or num_dice > 100:

       continue

   # Prompt the user for the number of rolls to perform

   num_rolls = int(input("Enter the number of rolls to perform (1-1000): "))

   if num_rolls < 1 or num_rolls > 1000:

       continue

   # Simulate the dice rolls and print the results

   for i in range(num_rolls):

       roll = 0

       for j in range(num_dice):

           roll += random.randint(1, 6)

       print(f"Roll {i+1}: {roll}")

   # Ask the user if they want to roll again

   again = input("Roll again? (Y/N): ").upper()

   if again != "Y":

       break

Explanation:

In this program, we first import the random module to use its randint function to generate random numbers for the dice rolls. We then enter a while loop that will continuously prompt the user for input until they enter a valid number of dice and rolls. Within the while loop, we prompt the user for the number of dice to roll and the number of rolls to perform. If the user enters an invalid number of dice or rolls, we continue back to the beginning of the loop and prompt the user again.

Once the user has entered a valid number of dice and rolls, we use a for loop to simulate the dice rolls. For each roll, we use another for loop to roll the specified number of dice and add up the results. We then print the total for each roll. After all of the rolls have been performed, we ask the user if they want to roll again. If they enter "Y", we continue back to the beginning of the while loop to prompt them for new input. If they enter anything else, we break out of the while loop and end the program.

Overall, this program allows a user to choose to roll between 1 and 100 dice between 1 and 1000 times, and simulates the dice rolls using random numbers and loops.

8 0
1 year ago
What is it called when you let the mouse pointer pause for a moment or two over an item?
katovenus [111]

When you let the mouse pointer pause for a moment or two over an item, it is called Hovering. Hovering means positioning the pointer to a specific object without clicking yet any mouse buttons. You also do not move it for at least a second. Hovering the mouse pointer may have the targeted object display its infotip or tooltip. 

8 0
3 years ago
Other questions:
  • Which tag pair contains the items in an ordered or unordered list?
    12·1 answer
  • Which function can you use to abbreviate the lengthy expression, A1+A2+A3+A3...+A19+A20?  MAX COUNT SUM ROUND
    10·2 answers
  • Consider the following sequence of items 10, 36, 25, 54, 37, 12, 75, 68, 42, 86, 72, 90. Insert these items in the order above,
    5·1 answer
  • What is the missing line of code?
    7·1 answer
  • Give your own example of a nested conditional that can be modified to become a single conditional, and show the equivalent singl
    12·1 answer
  • Provide an example where a company has demonetized a market or industry.
    8·1 answer
  • 3. Radheshree has to complete her assignment and submit it on the next day. While typing
    9·1 answer
  • Will social media lose its relevance?​
    6·1 answer
  • Which two keys are commonly used to move or insert data?.
    12·1 answer
  • What is the significance of the scientific method?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!