Question

Write a python

[Eng ver.]
Create a program that prints the largest number, a decimal number, among the N numbers you enter.
(Of the N numbers, a decimal number must be included at least one.)
[Example]

>N: 5 Enter a number : 1 Enter a number : 5 Enter a number : 78 Enter a number : 4 Enter a number : 3 Output : 5

0 0
Add a comment Improve this question Transcribed image text
Answer #1

RAW CODE

total =  int(input("N: ")) ## Getting input and converting to int
numbers = [] ## making a list to append numbers
for _ in range(total):
    number =  input("Enter a number : ") ## getting numbers
    numbers.append(number) ## Storing in list
print("Output :",max(numbers)) ## Max will return the largest number

SCREENSHOT (CODE WITH OUTPUT)

main.py Run Shell Clear 4 1 total = int(input(N: )) ## Getting input and converting to int 2 numbers = [] ## making a list

##### FOR ANY QUERY, KINDLY GET BACK, THANKYOU. #####

Add a comment
Know the answer?
Add Answer to:
Write a python [Eng ver.] Create a program that prints the largest number, a decimal number,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • The sequence of the first twelve Lucas numbers is: 2,1,3,4,7,11,18,29,47 … Please write a program for...

    The sequence of the first twelve Lucas numbers is: 2,1,3,4,7,11,18,29,47 … Please write a program for calculating the Lucas number Ln given the number n. Print out the results given: a) n=2 ; b) n=5 and c) n=10 (**please answer in Python**) Ln 2 1 (Ln-1 + Ln-2 if n= 0 if n = 1 if n >1

  • important don't use arrays or listed pleaseeeee in python 3 Write a program that given a...

    important don't use arrays or listed pleaseeeee in python 3 Write a program that given a collection of ?N numbers will find the largest value, its frequency and the average of the ?N numbers. Get the value of ?N from the user. If ?≤0N≤0, display an appropriate error message and terminate the program; otherwise Read the values as entered from the user. (If ?=5N=5, then there are 5 values the user is going to enter). Find the largest, its frequency...

  • 1) Translate the following equation into a Python assignment statement 2) Write Python code that prints...

    1) Translate the following equation into a Python assignment statement 2) Write Python code that prints PLUS, MINUS, O ZERO, depending on the value stored in a variable named N. 3) What is printed by: 3 - 1 while 5: while 10 Print ) Page 1 of 9 4) Write a Python while loop that reads in integers until the user enters a negative number, then prints the sum of the numbers. 1-2 of 9 4) Write a Python while...

  • USING PYTHON PLEASE Write a program that calculates the factorial value of a number entered by...

    USING PYTHON PLEASE Write a program that calculates the factorial value of a number entered by the user. Remember that x! =x* (x-1)* (x-2)*... *3+ 2* 1. Your program should check the value input by the user to ensure it is valid (i.e., that it is a number > =1). To do this, consider looking at the is digit() function available in Python. If the user enters an incorrect input, your program should continue to ask them to enter a...

  • C++ 3. Write a program that recursively calculates n factorial (n!) a) Main should handle all...

    C++ 3. Write a program that recursively calculates n factorial (n!) a) Main should handle all input and output b) Create a function that accepts a number n and returns n factorial c) Demonstrate the function with sample input from console. n! n * n-1 * n-2 * n-3, for all n > 0 For example, 3!-3 21-6 using a recursive process to do so. Example output (input in bold italics) Enter a number: 5 5120

  • Please code in ARM cm4 Problem 5 Write a program that corresponds to the following C...

    Please code in ARM cm4 Problem 5 Write a program that corresponds to the following C code: if (a > b) c = c + 5; if (a < b) c = c - 5; if (a == b) c = c + 10; Assume that a, b and c are 32-bit signed integers stored in memory at labels AO, BO, and Co, respectively.

  • All in C++ Create a function NumEven( std: forward_list-int> SList) that computes and returns the number...

    All in C++ Create a function NumEven( std: forward_list-int> SList) that computes and returns the number of even values in a singly linked list SList of type std: forward_list-int> If there is no even value or the list is empty, return 0. Select the appropriate C++ statement for each of the below to implement the function. unsigned NumEven (std:: forward_list<int> Slist) { Select] Select ] Select ] } [ Select] for (int i; i < num; i++) { if (n...

  • Python Programming Write a program that reads the dimension of a rectangle and prints its area....

    Python Programming Write a program that reads the dimension of a rectangle and prints its area. The program must handle errors such invalid input. If it encounters an error, it should ask the user to reenter the input. Sample run: Enter height:abc abc is not a vaid input. Try again. Enter height:10 Enter width:hello hello is not a vaid input. Try again. Enter width:world world is not a vaid input. Try again. Enter width:xyz xyz is not a vaid input....

  • This CSIS 9 Python. Java Python Warmup-2 > string_times prev next | chance Given a string...

    This CSIS 9 Python. Java Python Warmup-2 > string_times prev next | chance Given a string and a non-negative int n, return a larger string that is n copies of the original string. string_times('Hi', 2) – 'HiHi' string_times('Hi', 3) - 'HiHiHi' string_times('Hi', 1) – 'Hi' Solution: Go Save, Compile, Run (ctrl-enter) Show Solution def string_times (str, n): def string_times(str, n): result = "" for i in range(n): # range(n) is [0, 1, 2, .... n-1] result = result + str...

  • #include <stdlib.h> using namespace std; #include "structs.h" // This function prints (iteratively) the contents of the...

    #include <stdlib.h> using namespace std; #include "structs.h" // This function prints (iteratively) the contents of the list. void ListClass::printList() NodePtr Type ptr = head; // Il // // // Il // The following is the code necessary to print out the items in the list. Each node is printed on a line with the account number then a tab then the balance. To output a tab character, use cout << "\t" Do not output any labels. Just put the contents...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT