Instantly share code, notes, and snippets.

@jennyonjourney

jennyonjourney / 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,

  • Download ZIP
  • Star ( 11 ) 11 You must be signed in to star a gist
  • Fork ( 5 ) 5 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 jennyonjourney/c032a1f4e25d4d03e4601b3536f77f92 to your computer and use it in GitHub Desktop.
largest = None
smallest = None
while True:
inp = raw_input("Enter a number: ")
if inp == "done" : break
try:
num = float(inp)
except:
print ("Invalid input")
continue
if smallest is None:
smallest = num
if num > largest :
largest = num
elif num < smallest :
smallest = num
def done(largest,smallest):
print ("Maximum is", int(largest))
print ("Minimum is", int(smallest))
done(largest,smallest)

@SmaranikaBiswas

SmaranikaBiswas commented Sep 25, 2021

largest = None smallest = None num = 0 while True: num = input("Enter a number: ") if num == "done" : break try: numb = int(num) except: print ("Invalid input") continue if smallest is None: smallest = numb elif numb < smallest : smallest = numb if largest is None: largest = numb elif numb > largest: largest = numb print ("Maximum is", largest) print ("Minimum is", smallest)

This is a correct code. It's absolutely run and match the output.

Sorry, something went wrong.

@KhaledE21

KhaledE21 commented Nov 14, 2021

image

mdshamimchowdhury commented Jan 19, 2022

Now you Must Try This one

num = 0 largest = -1 smallest = None while True: num = input("Enter a number: ") if num == "done" : break try : numb = int(num) except : print('Invalid input') if smallest is None : smallest = numb elif numb < smallest : smallest = numb elif numb > largest : largest = numb print("Maximum is", largest) print("Minimum is", smallest)

Now you should try to enter output: 7 then 2 then bob then 10 then 4 then done

@initiatorvaibhav

initiatorvaibhav commented Feb 21, 2022

# newer update

largest = None smallest = None while True: inp = input("Enter a number: ") if inp == "done": break try: num = float(inp) except: print("Invalid input") continue if smallest is None: smallest = num largest = num if num < smallest: smallest = num elif num > largest: largest = num print("Maximum is", int(largest)) print("Minimum is", int(smallest))

@rovesoul

rovesoul commented Feb 21, 2022 via email

@Abi-London

Abi-London commented Mar 21, 2022

largest = None smallest = None while True: num = input("Enter a number: ") if num == "done": break try: numb=int(num) except: print('Invalid input') continue if largest is None: largest=numb elif largest<numb: largest=numb if smallest is None: smallest=numb elif numb<smallest: smallest=numb print("Maximum", largest) print("Minimum", smallest)

rovesoul commented Mar 21, 2022 via email

@chenchen218

chenchen218 commented May 10, 2022

my code for this practice:

large = None small = None

while True: num = input('please enter a vallue<<') try: if num == 'done': print('program finished') break number = int(num) except: print('please enter a numeric value') if small is None or small > number: small = number if large is None or large < number: large = number

print('MAX NUM: ',large, 'MIN NUM:',small)

rovesoul commented May 10, 2022 via email

@WitherspoonD

WitherspoonD commented Oct 16, 2022

The code checker is case sensitive.

rovesoul commented Oct 16, 2022 via email

@techfresher

techfresher commented Nov 23, 2022

Capture online assignment

please help out

rovesoul commented Nov 23, 2022 via email

Rovesoul commented jan 9, 2023 via email.

@mohamednazeih

mohamednazeih commented Jan 16, 2023

largest = None smallest = None while True: num = input("Enter a number: ")

print("Maximum is", largest) print("Minimum is", smallest)

@amw514

amw514 commented Apr 3, 2023

Rovesoul commented apr 3, 2023 via email.

@iqtidarali

iqtidarali commented Apr 17, 2023

image

work for me hope for you guys as well

rovesoul commented Apr 17, 2023 via email

@anitasoaares

anitasoaares commented May 29, 2023 • edited Loading

image

rovesoul commented May 29, 2023 via email

@Irajam

Irajam commented Aug 27, 2023

can pls someone help me, i have been trying a lot of different things and this mismatch is always appearing. I dont know what i am doing wrong. I have tried without the quit() but is the same thing.

did you find any solution for this? i have same issue, i tried several codes but not working

rovesoul commented Aug 27, 2023 via email

 alt=

johnny-official commented Sep 14, 2023

Rovesoul commented sep 14, 2023 via email.

@tadeletekeba13

tadeletekeba13 commented Oct 14, 2023

"Hello, everyone. Could you kindly assist me with this exercise?

I am encountering difficulties, and nothing seems to be effective.

largest = None smallest = None

while True : num = input ('Enter a number :') if num=='done': break #elif num =='Done': #break try : fnum = float (num ) except: print ('Invaild input') continue if largest in None: largest = fnum elif fnum > largest: largest = fnum #print (fnum) if smallest is None : smallest =fnum #print (fnum) Print ('Maximum is', int(largest)) Print ('Minimum is' , int(smallest)) IS NOT WORKIG

Exercise 5 2 is no

rovesoul commented Oct 14, 2023 via email

Rovesoul commented oct 30, 2023 via email.

@HyugasV

HyugasV commented Oct 30, 2023

Guys my code is like that and it's working is it true ?

numlist = [] while True: num = input("Enter a number: ") if num == "done": break try: num = int(num) (numlist.append(num)) largest = max(numlist) smallest = min(numlist) except: print("Invalid input")

APDaga DumpBox : The Thirst for Learning...

  • 🌐 All Sites
  • _APDaga DumpBox
  • _APDaga Tech
  • _APDaga Invest
  • _APDaga Videos
  • 🗃️ Categories
  • _Free Tutorials
  • __Python (A to Z)
  • __Internet of Things
  • __Coursera (ML/DL)
  • __HackerRank (SQL)
  • __Interview Q&A
  • _Artificial Intelligence
  • __Machine Learning
  • __Deep Learning
  • _Internet of Things
  • __Raspberry Pi
  • __Coursera MCQs
  • __Linkedin MCQs
  • __Celonis MCQs
  • _Handwriting Analysis
  • __Graphology
  • _Investment Ideas
  • _Open Diary
  • _Troubleshoots
  • _Freescale/NXP
  • 📣 Mega Menu
  • _Logo Maker
  • _Youtube Tumbnail Downloader
  • 🕸️ Sitemap

Coursera: Machine Learning - All weeks solutions [Assignment + Quiz] - Andrew NG

Coursera: Machine Learning - All weeks solutions [Assignment + Quiz] - Andrew NG

Recommended Machine Learning Courses: Coursera: Machine Learning    Coursera: Deep Learning Specialization Coursera: Machine Learning with Python Coursera: Advanced Machine Learning Specialization Udemy: Machine Learning LinkedIn: Machine Learning Eduonix: Machine Learning edX: Machine Learning Fast.ai: Introduction to Machine Learning for Coders

=== Week 1 ===

Assignments: .

  • No Assignment for Week 1
  • Machine Learning (Week 1) Quiz ▸  Introduction
  • Machine Learning (Week 1) Quiz ▸  Linear Regression with One Variable
  • Machine Learning (Week 1) Quiz ▸  Linear Algebra

=== Week 2 ===

Assignments:.

  • Machine Learning (Week 2) [Assignment Solution] ▸ Linear regression and get to see it work on data.
  • Machine Learning (Week 2) Quiz ▸  Linear Regression with Multiple Variables
  • Machine Learning (Week 2) Quiz ▸  Octave / Matlab Tutorial

=== Week 3 ===

  • Machine Learning (Week 3) [Assignment Solution] ▸ Logistic regression and apply it to two different datasets
  • Machine Learning (Week 3) Quiz ▸  Logistic Regression
  • Machine Learning (Week 3) Quiz ▸  Regularization

=== Week 4 ===

  • Machine Learning (Week 4) [Assignment Solution] ▸ One-vs-all logistic regression and neural networks to recognize hand-written digits.
  • Machine Learning (Week 4) Quiz ▸  Neural Networks: Representation

=== Week 5 ===

  • Machine Learning (Week 5) [Assignment Solution] ▸ Back-propagation algorithm for neural networks to the task of hand-written digit recognition.
  • Machine Learning (Week 5) Quiz ▸  Neural Networks: Learning

=== Week 6 ===

  • Machine Learning (Week 6) [Assignment Solution] ▸ Regularized linear regression to study models with different bias-variance properties.
  • Machine Learning (Week 6) Quiz ▸  Advice for Applying Machine Learning
  • Machine Learning (Week 6) Quiz ▸  Machine Learning System Design

=== Week 7 ===

  • Machine Learning (Week 7) [Assignment Solution] ▸ Support vector machines (SVMs) to build a spam classifier.
  • Machine Learning (Week 7) Quiz ▸  Support Vector Machines

=== Week 8 ===

  • Machine Learning (Week 8) [Assignment Solution] ▸ K-means clustering algorithm to compress an image. ▸ Principal component analysis to find a low-dimensional representation of face images.
  • Machine Learning (Week 8) Quiz ▸  Unsupervised Learning
  • Machine Learning (Week 8) Quiz ▸  Principal Component Analysis

=== Week 9 ===

  • Machine Learning (Week 9) [Assignment Solution] ▸ Anomaly detection algorithm to detect failing servers on a network. ▸ Collaborative filtering to build a recommender system for movies.
  • Machine Learning (Week 9) Quiz ▸  Anomaly Detection
  • Machine Learning (Week 9) Quiz ▸  Recommender Systems

=== Week 10 ===

  • No Assignment for Week 10
  • Machine Learning (Week 10) Quiz ▸  Large Scale Machine Learning

=== Week 11 ===

  • No Assignment for Week 11
  • Machine Learning (Week 11) Quiz ▸  Application: Photo OCR Variables

coursera assignment answers

Question 5 Your friend in the U.S. gives you a simple regression fit for predicting house prices from square feet. The estimated intercept is -44850 and the estimated slope is 280.76. You believe that your housing market behaves very similarly, but houses are measured in square meters. To make predictions for inputs in square meters, what intercept must you use? Hint: there are 0.092903 square meters in 1 square foot. You do not need to round your answer. (Note: the next quiz question will ask for the slope of the new model.) i dint get answer for this could any one plz help me with it

coursera assignment answers

Please comment below specific week's quiz blog post. So that I can keep on updating that blog post with updated questions and answers.

coursera assignment answers

This comment has been removed by the author.

Good day Akshay, I trust that you are doing well. I am struggling to pass week 2 assignment, can you please assist me. I am desperate to pass this module and I am only getting 0%... Thank you, I would really appreat your help.

Our website uses cookies to improve your experience. Learn more

Contact form

Deep-Learning-Specialization-Coursera

This repo contains the updated version of all the assignments/labs (done by me) of deep learning specialization on coursera by andrew ng. it includes building various deep learning models from scratch and implementing them for object detection, facial recognition, autonomous driving, neural machine translation, trigger word detection, etc., deep learning specialization coursera [updated version 2021].

GitHub Repo

Announcement

[!IMPORTANT] Check our latest paper (accepted in ICDAR’23) on Urdu OCR

UTRNet

This repo contains all of the solved assignments of Coursera’s most famous Deep Learning Specialization of 5 courses offered by deeplearning.ai

Instructor: Prof. Andrew Ng

This Specialization was updated in April 2021 to include developments in deep learning and programming frameworks. One of the most major changes was shifting from Tensorflow 1 to Tensorflow 2. Also, new materials were added. However, Most of the old online repositories still don’t have old codes. This repo contains updated versions of the assignments. Happy Learning :)

Programming Assignments

Course 1: Neural Networks and Deep Learning

  • W2A1 - Logistic Regression with a Neural Network mindset
  • W2A2 - Python Basics with Numpy
  • W3A1 - Planar data classification with one hidden layer
  • W3A1 - Building your Deep Neural Network: Step by Step¶
  • W3A2 - Deep Neural Network for Image Classification: Application

Course 2: Improving Deep Neural Networks: Hyperparameter tuning, Regularization and Optimization

  • W1A1 - Initialization
  • W1A2 - Regularization
  • W1A3 - Gradient Checking
  • W2A1 - Optimization Methods
  • W3A1 - Introduction to TensorFlow

Course 3: Structuring Machine Learning Projects

  • There were no programming assignments in this course. It was completely thoeretical.
  • Here is a link to the course

Course 4: Convolutional Neural Networks

  • W1A1 - Convolutional Model: step by step
  • W1A2 - Convolutional Model: application
  • W2A1 - Residual Networks
  • W2A2 - Transfer Learning with MobileNet
  • W3A1 - Autonomous Driving - Car Detection
  • W3A2 - Image Segmentation - U-net
  • W4A1 - Face Recognition
  • W4A2 - Neural Style transfer

Course 5: Sequence Models

  • W1A1 - Building a Recurrent Neural Network - Step by Step
  • W1A2 - Character level language model - Dinosaurus land
  • W1A3 - Improvise A Jazz Solo with an LSTM Network
  • W2A1 - Operations on word vectors
  • W2A2 - Emojify
  • W3A1 - Neural Machine Translation With Attention
  • W3A2 - Trigger Word Detection
  • W4A1 - Transformer Network
  • W4A2 - Named Entity Recognition - Transformer Application
  • W4A3 - Extractive Question Answering - Transformer Application

I’ve uploaded these solutions here, only for being used as a help by those who get stuck somewhere. It may help them to save some time. I strongly recommend everyone to not directly copy any part of the code (from here or anywhere else) while doing the assignments of this specialization. The assignments are fairly easy and one learns a great deal of things upon doing these. Thanks to the deeplearning.ai team for giving this treasure to us.

Connect with me

Name: Abdur Rahman

Institution: Indian Institute of Technology Delhi

Find me on:

LinkedIn

Category: Coursera

Data structures and performance | week 6, data structures and performance | week 5, data structures and performance | week 4, data structures and performance | week 3, data structures and performance | week 2, data structures and performance | week 1, algorithmic toolbox | week 6, algorithmic toolbox | week 5, algorithmic toolbox | week 4, algorithmic toolbox | week 3.

Answers for Quizzes & Assignments that I have taken

Coursera and edx assignments.

This repository is aimed to help Coursera and edX learners who have difficulties in their learning process. The quiz and programming homework is belong to coursera and edx and solutions to me.

AWS Certified Solutions Architect - Professional

Devops on aws specialization, open source software development, linux and git specialization, edhec - investment management with python and machine learning specialization.

EDHEC - Portfolio Construction and Analysis with Python

EDHEC - Advanced Portfolio Construction and Analysis with Python

Google Data Analytics Professional Certificate

Google - Foundations: Data, Data, Everywhere

Google - Ask Questions to Make Data-Driven Decisions

Google - Prepare Data for Exploration

Google - Process Data from Dirty to Clean

Google - Analyze Data to Answer Questions

Google - Share Data Through the Art of Visualization

Google - Data Analysis with R Programming

Google - Google Data Analytics Capstone: Complete a Case Study

University of Michigan - PostgreSQL for Everybody Specialization

The university of melbourne & the chinese university of hong kong - basic modeling for discrete optimization, stanford university - machine learning, imperial college london - mathematics for machine learning specialization.

Imperial College London - Linear Algebra

Imperial College London - Multivariate Calculus

University of Colorado Boulder - Excel/VBA for Creative Problem Solving Specialization

  • University of Colorado Boulder - Excel/VBA for Creative Problem Solving, Part 1

University of Washington - Machine Learning Specialization

University of Washington - A Case Study Approach

University of Washington - Regression

Rice University - Python Data Representations

Rice university - python data analysis, rice university - python data visualization, johns hopkins university - data science specialization.

Johns Hopkins University - R Programming

Johns Hopkins University - Getting and Cleaning Data

Johns Hopkins University - Exploratory Data Analysis

Johns Hopkins University - Reproducible Research

Saint Petersburg State University - Competitive Programmer’s Core Skills

Rice university - business statistics and analysis capstone, university of california, san diego - object oriented programming in java, university of california, san diego - data structures and performance, university of california, san diego - advanced data structures in java, ibm: applied data science specialization.

IBM: Open Source tools for Data Science

IBM: Data Science Methodology

IBM: Python for Data Science

IBM: Databases and SQL for Data Science

IBM: Data Analysis with Python

IBM: Data Visualization with Python

IBM: Machine Learning with Python

IBM: Applied Data Science Capstone Project

deeplearning.ai - TensorFlow in Practice Specialization

deeplearning.ai - Introduction to TensorFlow for Artificial Intelligence, Machine Learning, and Deep Learning

deeplearning.ai - Convolutional Neural Networks in TensorFlow

deeplearning.ai - Natural Language Processing in TensorFlow

deeplearning.ai - Sequences, Time Series and Prediction

Alberta Machine Intelligence Institute - Machine Learning Algorithms: Supervised Learning Tip to Tail

University of helsinki: object-oriented programming with java, part i, the hong kong university of science and technology - python and statistics for financial analysis, google it automation with python professional certificate.

Google - Crash Course on Python

Google - Using Python to Interact with the Operating System

Delft University of Technology - Automated Software Testing

University of maryland, college park: cybersecurity specialization.

University of Maryland, College Park: Software Security

University of Maryland, College Park: Usable Security

University of Maryland, College Park: Programming Mobile Applications for Android Handheld Systems: Part 1

Harvard university - introduction to computer science cs50x, duke university - java programming: principles of software design, duke university - java programming: solving problems with software, duke university - java programming: arrays, lists, and structured data, duke university - data science math skills, massachusetts institute of technology - introduction to computer science and programming using python 6.00.1x, massachusetts institute of technology - introduction to computational thinking and data science 6.00.2x, johns hopkins university: ruby on rails web development specialization.

Johns Hopkins University - Ruby on Rails

Johns Hopkins University - Rails with Active Record and Action Pack

Johns Hopkins University - Ruby on Rails Web Services and Integration with MongoDB

Johns Hopkins University - HTML, CSS, and Javascript for Web Developers

Johns Hopkins University - Single Page Web Applications with AngularJS

University of Michigan - Web Design for Everybody: Web Development & Coding Specialization

University of Michigan - HTML5

University of Michigan - CSS3

University of Michigan - Interactivity with JavaScript

Stanford University - Introduction to Mathematical Thinking

University of london - responsive website development and design specialization.

University of London - Responsive Web Design

University of London - Web Application Development with JavaScript and MongoDB

University of London - Responsive Website Tutorial and Examples

University of California, San Diego - Biology Meets Programming: Bioinformatics

University of toronto - learn to program: the fundamentals, university of toronto - learn to program: crafting quality code, university of british columbia - how to code: simple data htc1x, university of british columbia - software construction: data abstraction, university of british columbia - software construction: object-oriented design.

foundations of user experience (ux) design coursera answers

Week 1 – introducing user experience design.

foundations of user experience (ux) design coursera answers week 1 Weekly challenge 1: The basics of user experience design 1. Fill in the blank: The

Week 2 – Thinking like a UX designer

Week 3 – joining design sprints.

foundations of user experience (ux) design coursera answers week 3 1. Identify questions you should ask during a design sprint retrospective. Select all that apply.

Week 4 – Integrating research into the design process

foundations of user experience (ux) design coursera answers week 4 Weekly Challenge 4: Research in the design process 1. UX research focuses on understanding user

IMAGES

  1. Creative Problem Solving Coursera Quiz Answers

    coursera assignment answers

  2. Activity Create a project charter Coursera

    coursera assignment answers

  3. Introduction To Data Analytics IBM

    coursera assignment answers

  4. Data structure coursera quiz answer || Data Structures assignment solution || Data structure answer

    coursera assignment answers

  5. Coursera |Project Management The Basics for Success| Planning and Scheduling quiz answers

    coursera assignment answers

  6. Weekly challenge 2 -Terms, tools, and frameworks in UX design

    coursera assignment answers

VIDEO

  1. Assignment 9.4 Python Data Structures

  2. Coursera: IBM

  3. Coursera Data Analysis with R Programming

  4. Coursera

  5. Coursera

  6. Coursera-Foundations: Data, Data, Everywhere- week 2 answer-Weekly challenge 2 assessment answer