CS 110 Lecture 5: CS 110 Lesson 5 notes

52 views2 pages
13 Sep 2016
Course
Professor

Document Summary

Parse error/syntax error: writing code incorrectly, such as forgetting a colon or parenthesis. Type error: the value that is put into a variable cannot work with the function called. Example: range(1. 5,10. 5: will cause a type error because the range() function only takes integers as parameters. Name error: trying to use a variable that doesn"t exist or doesn"t have a value yet. Data error: the data itself is messed up. Not necessarily the wrong type, just a logical error: example: trying to divide by 0. The shell will tell you where the error is located, and is correct for the most part: The syntax for creating functions is to start the function with def. Function names are put in camel case def rangeenhanced(): Function header contains the name and parameters def rangeenhanced(start,end,step): All the code within a function must be indented in python. Anything indented along the same line is called a code block.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents