×

### Let's log you in.

or

Don't have a StudySoup account? Create one here!

×

### Create a StudySoup account

#### Be part of our community, it's free to join!

or

##### By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

by: Eunice

18

0

2

# Week 7 Notes CS 1110-002

Eunice
Cornell

Get a free preview of these Notes, just enter your email below.

×
Unlock Preview

### Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

While loop examples Infinite loops Logical maneuvers (assertions, etc) See lecture slides for examples
COURSE
Intro to Computing using Python
PROF.
Lee, Van Loan
TYPE
Class Notes
PAGES
2
WORDS
CONCEPTS
CS, Python
KARMA
25 ?

## Popular in ComputerScienence

This 2 page Class Notes was uploaded by Eunice on Saturday March 12, 2016. The Class Notes belongs to CS 1110-002 at Cornell University taught by Lee, Van Loan in Spring 2016. Since its upload, it has received 18 views. For similar materials see Intro to Computing using Python in ComputerScienence at Cornell University.

×

## Reviews for Week 7 Notes

×

×

### What is Karma?

#### You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 03/12/16
CS 1110 Van Loan and Lee Spring 2016 March 8, 2016  if the variable that is assigned to another is updated, the other variable doesn’t update with it  while loop o open ended iteration o refining the sqrt  for loop will execute for the number of times you input  while loop will execute until it is at a specified error margin o up/down sequence  given a number n  if even, replace by its half  if odd, replace by 3n+1  will you always end up at 1 o with open-ended, it is possible that the loop won’t end  infinite loop  insert a condition to end the loop after a certain number of steps given that it hasn’t ended on its own March 10, 2016  logical maneuvers o loop body returns o logical maneuvers make codes more user friendly  corrects and points out errors  importerror o importing something that doesn’t exist  nameerror o a variable hasn’t been defined  typeerror o ex. dividing a string by an integer  zerodivisionerror o can’t divide by zero  assertions  ability to generate exceptions  “assert [Boolean expression],[string]” o is Boolean is not true then string is printed and an exception is made  type checking o use assert and the function isinstance o ex. isinstance(x,int)  if x houses an int then It’s true  check for strings and floats too  try-except construction  try: o code that may generate a particular exception  except [name of exception]: o code to execute if specified exception is found  break  a way to terminate a loop

×

×

×

### You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

## Why people love StudySoup

Jim McGreen Ohio University

#### "Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Jennifer McGill UCSF Med School

#### "Selling my MCAT study guides and notes has been a great source of side revenue while I'm in school. Some months I'm making over \$500! Plus, it makes me happy knowing that I'm helping future med students with their MCAT."

Steve Martinelli UC Los Angeles

#### "There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Parker Thompson 500 Startups

#### "It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!
×

### Refund Policy

#### STUDYSOUP CANCELLATION POLICY

All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email support@studysoup.com

#### STUDYSOUP REFUND POLICY

StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here: support@studysoup.com

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to support@studysoup.com

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.