• View Today's Posts
• View New Posts
• My Discussions
• Member List
• Interpreter

## Python for Everybody 5.2 assignment

• Python Forum
• Python Coding
• 2 Vote(s) - 4 Average
• View a Printable Version

## User Panel Messages

Announcements.

Instantly share code, notes, and snippets.

## jmangrad / Exercise 5.2 - Python for Everybody

• Star 1 You must be signed in to star a gist
• Fork 0 You must be signed in to fork a gist
• Embed Embed this gist in your website.
• Share Copy sharable link for this gist.
• Clone via HTTPS Clone using the web URL.
• Save jmangrad/8aa25d1cd21b564eb0457114441e5d8b to your computer and use it in GitHub Desktop.

## Edeath-9 commented Mar 25, 2022

I have written this code but in case of largest and smallest number it is showing done. How to fix this

Sorry, something went wrong.

## newbie-Ds commented Jun 7, 2022 • edited

I think it's because you put while True: number = input("Enter a Number: ") largest = number ------------------ if you enter 'done', here returns to 'done' smallest = number ------------------ if you enter 'done', here returns to 'done'

Let's try if this works.

## kholoud24 commented Aug 5, 2022

maxum = False minum = False while True: input_value = input("enter number\n") if input_value == 'done': break try: input_value = int(input_value) if not maxum or maxum < input_value: maxum = input_value

print('max is ', maxum, 'min is', minum)

## Minting-2022 commented Nov 9, 2022

When I enter a number,it just shows the'Invalid input',how can I fix it? count=0 total=0 largest=None smallest=None

while True: number=input("Enter a number: ") if number=='done': break try: fnum=float(number) if number=='done': break if largest<=fnum: largest=fnum if smallest>=fnum: smallest=fnum except: print("Invalid input") continue total=total+fnum count=count+1

print(total,count,largest,smallest)

## gaurvimadan commented Nov 13, 2022 • edited

I guess the problem is that you have used below mentioned if statement twice. It shouldn't be added in try statement. if number=='done': break

I tried solving the question in the below mentioned way, maybe it can help you.

When I enter a number,it just shows the'Invalid input',how can I fix it? count=0 total=0 largest=None smallest=None while True: number=input("Enter a number: ") if number=='done': break try: fnum=float(number) if number=='done': break if largest<=fnum: largest=fnum if smallest>=fnum: smallest=fnum except: print("Invalid input") continue total=total+fnum count=count+1 print(total,count,largest,smallest)

## Coursera Programming for Everybody (Getting Started with Python) Week 5  Assignment 5.2

Question:    5.2 Write a program that repeatedly prompts a user for integer numbers until the user enters ‘done’. Once ‘done’ is entered, print out the largest and smallest of the numbers. If the user enters anything other than a valid number catch it with a try/except and put out an appropriate message and ignore the number. Enter 7, 2, bob, 10, and 4 and match the output below.

Do Not Only Use These Quizzes For Getting Certificates.You Can Take Help From These Quizzes Answer. All Quizzes & Contents Are Free Of Charge. ✅ If You Want Any Quiz Answers Then Please  Contact Us

• Programming for Everybody (Getting Started with Python) – Coursera Quiz Answers Programming for Everybody (Getting Started with Python) – Coursera 4.8 Stars (167,402 ratings)   Instructor: Charles Russell Severance Enroll Now   This Programming ... Read more...
• Assignment 2.2 | Week-4 | Programming for Everybody (Getting Started with Python) By Coursera   Coursera Programming for Everybody (Getting Started with Python) Week 4  Assignment 2.2   Question:  2.2 Write a program that uses input to prompt ... Read more...
• Chapter 5 (Quiz Answers) | Week-7 | Programming for Everybody (Getting Started with Python) By Coursera Coursera Programming for Everybody (Getting Started with Python) Week 7 Chapter 5 Graded Quiz • 30 min 1. What is ... Read more...
• Chapter 4 (Quiz Answers) | Week-6 | Programming for Everybody (Getting Started with Python) By Coursera Coursera Programming for Everybody (Getting Started with Python) Week 6 Chapter 4 Graded Quiz • 30 min 1. Which Python ... Read more...
• Chapter 3 (Quiz Answers) | Week-5 | Programming for Everybody (Getting Started with Python) By Coursera Coursera Programming for Everybody (Getting Started with Python) Week 5 Chapter 3 Graded Quiz • 30 min 1. What do ... Read more...
• Chapter 2 (Quiz Answers) | Week-4 | Programming for Everybody (Getting Started with Python) By Coursera Coursera Programming for Everybody (Getting Started with Python) Week 4 Chapter 2 Graded Quiz • 30 min 1. Which of ... Read more...

Save my name, email, and website in this browser for the next time I comment.

## How to Complete Assignment 5.2 in Python for Everybody?

As an AI language model, I don’t have access to specific assignments or courses like “Python for Everybody.” However, I can assist you with understanding the general approach to completing an assignment. If you can provide the specific requirements or description of Assignment 5.2, I’ll do my best to guide you through it.

In general, when completing an assignment in Python, you should follow these steps:

• Read and understand the assignment requirements: Carefully go through the assignment description to understand what is expected from you. Identify the input requirements, expected output, and any specific instructions provided.
• Plan your solution: Break down the problem into smaller steps and plan your approach. Consider what variables, data structures, or functions you may need to implement. If necessary, sketch out a rough outline or algorithm for solving the problem.
• Write your code: Implement your solution based on the plan you created. Start by writing the necessary code structure, such as importing any required libraries, defining functions, and creating variables.
• Test your code: Verify that your code works correctly by testing it with different inputs. Ensure that it produces the expected output for various scenarios, including edge cases and invalid inputs.
• Refine and optimize: Review your code for any improvements or optimizations that can be made. Consider readability, code structure, and potential performance enhancements. Refactor your code if necessary.
• Submit your solution: Once you are confident that your code meets the assignment requirements and works correctly, submit it according to the instructions provided by your course or instructor.

Remember to follow any specific guidelines or conventions given in the assignment. If you encounter any difficulties or have specific questions about a particular part of the assignment, feel free to ask for assistance, providing relevant details.

## How to Exit a forEach Loop Early in JavaScript?

More from author.

## How to find event Listeners on a dom Node using JavaScript?

You may also like:.

## How to Exercise Your JavaScript Ageing Skills?

#### IMAGES

1. [Coursera] Python for everybody 5.2 Assignment · GitHub

2. exercise 5. 2 python programming 4 everybody

3. Coursera: Python For Everybody Assignment 5.2 program solution

4. Python for Everybody 5.2 assignment

5. Py4e Assignment 5.2

6. [Coursera] Python for everybody 5.2 Assignment · GitHub

#### VIDEO

1. Python For Everybody Assignment 8.5

2. Assignment

3. Starting Out With Python Chapter 2 exercise Program 1 Personal Information Python Program

4. Разбор 5 задания на Python

5. "Python for Everybody" Chapter 11

6. Python for Informatics

1. [Coursera] Python for everybody 5.2 Assignment · GitHub

Star 11. Fork 5. [Coursera] Python for everybody 5.2 Assignment. Raw. 5.2 Write a program that repeatedly prompts a user for integer numbers until the user enters 'done'. Once 'done' is entered, print out the largest and smallest of the numbers. If the user enters anything other than a valid number catch it with a try,except and put out an ...

2. Coursera Python: Programming for everybody assignment 5.2

I have been taking Coursera's course, Programming for Everybody with Python. But one of the assignment 5.2 on week 7 got my attention. The objective is to make the user enter some numbers and enter done, when he entered all the numbers he wanted. After that, the output should be the biggest number and smallest number he entered. Here is the ...

3. Coursera Python for Everybody EP-13

Hi guys, in this video I solved the assignment 5.2 of Coursera Python for Everybody. Hope you find it useful.If you're new, Subscribe! https://www.youtube....

4. python-for-everybody/wk5

Contribute to ed-lau/python-for-everybody development by creating an account on GitHub. Class notes. Contribute to ed-lau/python-for-everybody development by creating an account on GitHub. ... Solutions For. Enterprise Teams Startups Education By Solution. CI/CD & Automation DevOps DevSecOps Resources. Learning Pathways White papers, Ebooks ...

5. Python For Everybody Assignment 5.2 solution

6. sersavn/coursera-python-for-everybody-specialization

Current repository contains all assignments, notes, quizzes and course materials from the "Python for Everybody Specialization" provided by Coursera and University of Michigan. - sersavn/coursera-python-for-everybody-specialization ... By Solution. CI/CD & Automation DevOps DevSecOps Resources. Learning Pathways White papers, Ebooks, Webinars ...

7. Python for Everybody 5.2 assignment

Joined: Oct 2017. Reputation: 1. #1. Oct-07-2017, 03:58 PM. Hey guys- I'm on my last assignment for Python and I need some expert assistance please. This is the assignment: 5.2 Write a program that repeatedly prompts a user for integer numbers until the user enters 'done'. Once 'done' is entered, print out the largest and smallest of the numbers.

8. Exercise 5.2

Raw. Exercise 5.2 - Python for Everybody. Write another program that prompts for a list of numbers. as above and at the end prints out both the maximum and minimum of. the numbers instead of the average. largest = None. smallest = None. count = 0.

9. Assignment 5.2

CourseraProgramming for Everybody (Getting Started with Python)Week 5 Assignment 5.2 Question: 5.2 Write a program that repeatedly prompts a user for integer numbers until the user enters 'done'. Once 'done' is entered, print out the largest and smallest of the numbers. If the user enters anything other than a valid number catch it…

10. Coursera Python Assignment 5.2 : r/learnpython

Hi there, I'm doing the last assignment for the Programming for Everybody (Getting Started with Python) course on Coursera, and I'm not quite understanding the solution. The assignment is 5.2 Write a program that repeatedly prompts a user for integer numbers until the user enters 'done'. Once 'done' is entered, print out the largest and ...

11. How to Complete Assignment 5.2 in Python for Everybody?

As an AI language model, I don't have access to specific assignments or courses like "Python for Everybody." However, I can assist you with understanding the general approach to completing an assignment. If you can provide the specific requirements or description of Assignment 5.2, I'll do my best to guide you through it.

12. Coursera

13. EngineerInd/Coursera-Python-for-everybody-solutions

Coursera: Programming For Everybody Assignment 5.2 program solution Answer | Python for Everybody Assignment 5.2 program solution. Hello friends, In this video we discussed about Coursera programming for everybody Assignment 5.2 answer other way it's known as Python for everybody Exercise 5.2 Complete program In this course Assignment (Exercise ...

14. Coursera python for everybody assignment 5.2 solution

Saved searches Use saved searches to filter your results more quickly

15. Coursera Python for Everybody EP-5

Hi guys, in this video I solved the assignment 2.2 of Coursera Python for Everybody. Hope you find it useful.If you're new, Subscribe! https://www.youtube....

16. Python for everybody assignment 3.3

The simplest solution is: ''' ... Need tips in Global Variables Assignment in Python for assignment. 6. ... Not sure what is wrong with this code for Python for Everybody 5.2. Hot Network Questions Zsh: How to workaround "no matches found" issue