COMP 1005 Lecture 5: Sept. 20 2016

31 views2 pages

Document Summary

Value: some data/piece of information (eg. 12) also called data and object. Types (datatype): str (strings) int (integers) float (decimal numbers) Variable: can be assigned to a value (refers to memory locations where data is stored) Can consist of letters (upper and lowercase), numbers and underscore symbol. Don"t start them with a capital or number. Don"t overwrite any functions (eg. print=12 don"t do that) Statement: unit of code python can execute (eg. assignment statement: Operator: function with special notation, more english phrases (eg. math operators- +,-,/, etc. ) Expression: combination of values, variables, operators and functions that evaluates to something (eg. mathematical) Can"t add string + integer (have to be same type of data) Basic input input() allows us to enter info from keyboard. # sign indicates a comment (only for english) ignored by interpreter. Syntax error: violated grammar of program (interpreter tells you this) Logic error: satisfies grammar but doesn"t quite do what you want it to.

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