Unladen Swallow
Oct-07-2017, 03:58 PM This is the Desired output:
Invalid input
Maximum is 10
Minimum is 2
This is my output:
7 ← Mismatch
2
bob
Please, enter only numbers.
10
4
Maximum 10
Minimum 2
I need help please.
Silly Frenchman
Oct-07-2017, 04:39 PM
Unladen Swallow
Oct-07-2017, 04:51 PM Lux Wrote: What's wrong with the output you're getting?
Check out my screenshot below:
I'm stumped. I'm tried everything I know to no avail. Desperately need some help on this.
Thank you all!
Silly Frenchman
Oct-07-2017, 04:56 PM seems to be why it's printing all the numbers- not sure if it's supposed to do that.
Unladen Swallow
Oct-07-2017, 05:08 PM
Thanks again for your time.
Silly Frenchman
Oct-07-2017, 05:12 PM (This post was last modified: Oct-07-2017, 05:12 PM by .) " instead of just "Maximum".
Unladen Swallow
Oct-07-2017, 05:14 PM
Unladen Swallow
May-31-2018, 04:22 PM
Unladen Swallow
Dec-12-2019, 05:12 PM This is the Desired output: Invalid input Maximum is 10 Minimum is 2 This is my output: 7 ← Mismatch 2 bob Please, enter only numbers. 10 4 Maximum 10 Minimum 2 I need help please.
Unladen Swallow
Apr-07-2020, 05:37 AM |
|
| | | | |
| | | | 46,791 | Jan-23-2021, 06:27 AM : |
| | | | 13,725 | Oct-22-2020, 11:57 AM : |
| | | | 12,458 | Jul-15-2020, 04:54 PM : |
| | | | 5,468 | Jun-06-2020, 08:59 AM : |
| | | | 6,567 | May-02-2020, 01:34 AM : |
| | | | 32,406 | Apr-08-2020, 06:49 AM : |
| | | | 8,910 | Dec-23-2019, 08:41 PM : |
| | | | 8,898 | Oct-22-2019, 08:08 AM : |
| | | | 16,343 | Jan-17-2019, 07:34 AM : |
User Panel Messages
Announcements.
Login to Python Forum
- Table of Contents
- Course Home
- Assignments
- Peer Instruction (Instructor)
- Peer Instruction (Student)
- Change Course
- Instructor's Page
- Progress Page
- Edit Profile
- Change Password
- Scratch ActiveCode
- Scratch Activecode
- Instructors Guide
- About Runestone
- Report A Problem
- Functions with Tuples and Dictionaries Mixed-Up Code Questions
- Functions and Conditionals Mixed-Up Code Questions
- Mixed-up Code Questions
- Functions and Lists Mixed-Up Code Questions
- Function and String Mixed-Up Code Questions
- Please join a research study to help us test new approaches to learning programming!
- Functions and Loops Mixed-Up Code Questions
- Functions Mixed-Up Code Questions
- Practice Problems
- An Introduction To Our System
- Self-efficacy Post-Survey
- Peer Instruction: Function Multiple Choice Questions
- Peer Instruction: Functions Multiple Choice Questions
- 5.1 Function calls
- 5.2 Built-in functions
- 5.3 Type conversion functions
- 5.4 Math functions
- 5.5 Random numbers
- 5.6 Adding new functions
- 5.7 Definitions and uses
- 5.8 Flow of execution
- 5.9 Parameters and arguments
- 5.10 Fruitful functions and void functions
- 5.11 Why functions?
- 5.12 Debugging
- 5.13 Glossary
- 5.14 Multiple Choice Questions
- 5.15 Mixed-up Code Questions
- 5.16 Write Code Questions
- 5.17 Group Work: Functions
- 5.18 Functions Multiple Choice Questions
- 5.19 Functions Mixed-Up Code Questions
- 5.20 Functions Write Code Questions
- 5.21 Group Work: Functions and Strings
- 5.22 Functions and Strings Multiple Choice Questions
- 5.23 Functions and Strings Mixed-Up Code Questions
- 5.24 Functions and Strings Write Code Questions
- 5.25 Group Work: Functions and Conditionals
- 5.26 Functions and Conditionals Multiple Choice Questions
- 5.27 Functions and Conditionals Mixed-Up Code Questions
- 5.28 Functions and Conditionals Write Code Questions
- 5.29 Group Work: Functions and Lists
- 5.30 Functions with Lists Multiple Choice Questions
- 5.31 Functions and Lists Mixed-Up Code Questions
- 5.32 Functions and Lists Write Code Questions
- 5.33 Group Work: Functions with Loops
- 5.34 Functions with Loops Multiple Choice Questions
- 5.35 Functions and Loops Mixed-Up Code Questions
- 5.36 Functions and Loops Write Code Questions
- 5.37 Group Work: Functions with Tuples and Dictionaries
- 5.38 Functions with Tuples and Dictionaries Multiple Choice Questions
- 5.39 Functions with Tuples and Dictionaries Mixed-Up Code Questions
- 5.40 Functions with Tuples and Dictionaries Write Code Questions
- 5.41 Group Work: Functions, Strings, and Conditionals
- 5.42 Group Work: Functions with Lists and Loops
- 5.43 Homework: Creating Functions from Sample Input and Output
- 5.44 Discussion: Creating Functions from Sample Input and Output
- 5.1. Function calls" data-toggle="tooltip">
- 5.3. Type conversion functions' data-toggle="tooltip" >
Before you keep reading...
Runestone Academy can only continue if we get support from individuals like you. As a student you are well aware of the high cost of textbooks. Our mission is to provide great books to you for free, but we ask that you consider a $10 donation, more if you can or less if $10 is a burden.
Making great stuff takes time and $$. If you appreciate the book you are reading now and want to keep quality materials free for other students please consider a donation to Runestone Academy. We ask that you consider a $10 donation, but if you can give more thats great, if $10 is too much for your budget we would be happy with whatever you can afford as a show of support.
5.2. Built-in functions ¶
Python provides a number of important built-in functions that we can use without needing to provide the function definition. The creators of Python wrote a set of functions to solve common problems and included them in Python for us to use.
The max and min functions give us the largest and smallest values in a list, respectively:
The max function gives us the value 4 because it is the largest value in the list. The min function, inversely, give us the value -2 because it is the smallest value in the list.
Q-2: What will be printed as the output of this code?
- Incorrect! You cannot use the max function to compare different data types. Try again.
- There is an error
- Correct! This code causes a TypeError because the max function cannot be used to compare different data types.
Another very common built-in function is the len function, which tells us how many items are in its argument. If the argument to len is a string, it returns the number of characters in the string.
These functions can operate on any set of values, as we will see in later chapters.
You should treat the names of built-in functions as reserved words (i.e., avoid using “max” as a variable name).
Activity: CodeLens 5.2.4 (functBuiltin_codelens_line2)
Q-5: Consider the code block below. What prints?
- Incorrect! Spaces and punctuation characters count in the length. Try again.
- Incorrect! Punctuation characters count in the length. Try again.
- Incorrect! Spaces count in the length. Try again.
- Correct! 13 is the length of all characters in the string, including spaces and punctuation.
Q-6: Which of the following would work as a variable name?
- Incorrect! This is a reserved keyword because it is a built-in function in Python. Try again.
- Correct! built_in is a valid variable name because it is not a built-in Python function.
Get the Reddit app
Subreddit for posting questions and asking for general advice about your python code.
An issue with Assignment 5.2 [Coursera Programming for Everybody]
Even if my code matches desired output, it shows the code is incorrect. I spent all day trying to fix the issue but failed. Could anyone please help me fix the issue?
Screenshot: https://prnt.sc/1fs2vr8
By continuing, you agree to our User Agreement and acknowledge that you understand the Privacy Policy .
Enter the 6-digit code from your authenticator app
You’ve set up two-factor authentication for this account.
Enter a 6-digit backup code
Create your username and password.
Reddit is anonymous, so your username is what you’ll go by here. Choose wisely—because once you get a name, you can’t change it.
Reset your password
Enter your email address or username and we’ll send you a link to reset your password
Check your inbox
An email with a link to reset your password was sent to the email address associated with your account
Choose a Reddit account to continue
IMAGES
VIDEO
COMMENTS
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. Input Cases: Enter 7, 2, bob, 10, and ...
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....
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.
Code link:https://drive.google.com/file/d/1HDYJ1BNgLPGk4P3sZRqcQvXuDNBuN1jK/view?usp=sharingCoursera: Python For Everybody Assignment 5.2 program solution | ...
The video is about the solution of the mentioned assignment of the python course named 'PYTHON FOR EVERYBODY' on coursera by Dr. Chuck
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
[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 appropriate message ...
[Coursera] Python for everybody 5.2 Assignment. GitHub Gist: instantly share code, notes, and snippets.
Community Support (Archived) — Edward Lundqvist asked a question. March 8, 2021 at 6:45 AM. Help with the assignment 5.2 in Python for everybody. I need help with the assignment 5.2 in Python for everybody. Somebody that could help me?
Star 1 1. Fork 0 0. 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.
Coursera: Programming For Everybody Assignment 5.2 program solution Answer | Python for Everybody Assignment 5.2 program solution.IF YOUR PROGRAM IS WORKING...
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…
This contains all the practices for the lectures, custom answers to the assignments and additional inline notes for "Python for Everybody Specialization" on Coursera by the University of Michigan. 42 stars 55 forks Branches Tags Activity
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 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.
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.
Activity: 5.2.3 The len function tells us how many items are in its argument. (functBuiltin_len) These functions can operate on any set of values, as we will see in later chapters. You should treat the names of built-in functions as reserved words (i.e., avoid using "max" as a variable name). 1. city_name = "Detroit".
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window.
An issue with Assignment 5.2 [Coursera Programming for Everybody] Even if my code matches desired output, it shows the code is incorrect. I spent all day trying to fix the issue but failed. Could anyone please help me fix the issue? Screenshot: https://prnt.sc/1fs2vr8. Also, as an aside, run your program with one number then "done." Even if my ...
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) are available in week 7 part.