Python Forum

  • View Active Threads
  • View Today's Posts
  • View New Posts
  • My Discussions
  • Unanswered Posts
  • Unread Posts
  • Active Threads
  • Mark all forums read
  • 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.

assignment 5 2 python for everybody solution

Login to Python Forum

Instantly share code, notes, and snippets.

@jmangrad

jmangrad / Exercise 5.2 - Python for Everybody

  • Download ZIP
  • 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.
  • Learn more about clone URLs
  • Save jmangrad/8aa25d1cd21b564eb0457114441e5d8b to your computer and use it in GitHub Desktop.

@Edeath-9

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

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

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

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

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)

assignment 5 2 python for everybody solution

Assignment 5.2 | Week-7 | Programming for Everybody (Getting Started with Python) By Coursera

Assignment 5.2 | Week-7 | Programming for Everybody (Getting Started with Python) By Coursera

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.

Assignment 5.2 | Week-7 | Programming for Everybody (Getting Started with Python) By Coursera

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

Related Questions & Answers:

  • 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...

Leave a Comment Cancel reply

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

assignment 5 2 python for everybody solution

How to Complete Assignment 5.2 in Python for Everybody?

assignment 5 2 python for everybody solution

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.

Avatar for LearnInfinite

You May Also Like

How to Exit Fullscreen in JavaScript?

How to Exit Fullscreen in JavaScript?

How to Exit a Loop in JavaScript?

How to Exit a Loop in JavaScript?

How to Exit a forEach Loop Early in JavaScript?

How to Exit a forEach Loop Early in JavaScript?

More from author.

How to persist state on refresh with React?

How to persist state on refresh with React?

How to Implement Polymorphism with Primitive Values in Object-Oriented JavaScript?

How to Implement Polymorphism with Primitive Values in Object-Oriented JavaScript?

+ there are no comments, leave a reply cancel reply.

assignment 5 2 python for everybody solution

How to Connect a Webcam Using Python?

assignment 5 2 python for everybody solution

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

You may also like:.

How to Return a Function Variable Outside of a Function in Python?

How to Return a Function Variable Outside of a Function in Python?

How to Exercise Your JavaScript Ageing Skills?

How to Exercise Your JavaScript Ageing Skills?

IMAGES

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

    assignment 5 2 python for everybody solution

  2. exercise 5. 2 python programming 4 everybody

    assignment 5 2 python for everybody solution

  3. Coursera: Python For Everybody Assignment 5.2 program solution

    assignment 5 2 python for everybody solution

  4. Python for Everybody 5.2 assignment

    assignment 5 2 python for everybody solution

  5. Py4e Assignment 5.2

    assignment 5 2 python for everybody solution

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

    assignment 5 2 python for everybody solution

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

COMMENTS

  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

    Code link:https://drive.google.com/file/d/1HDYJ1BNgLPGk4P3sZRqcQvXuDNBuN1jK/view?usp=sharingCoursera: Python For Everybody Assignment 5.2 program 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

    About Press Copyright Contact us Creators Advertise Developers Terms Privacy Policy & Safety How YouTube works Test new features NFL Sunday Ticket Press Copyright ...

  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