COMP 110 Lecture Notes - Lecture 7: Init, String Literal, Idiom

15 views15 pages
21 Aug 2020
School
Course

Document Summary

Variables: variables allow your programs to store, load, and changevalues in memory, every variable, has a name and. 2. is bound to a value of a specific data type. Initialize / assign: declare the variable with name & type. 2. (steps 1 and 2 can be combined!) Once 1 and 2 are done, then you can*: access the value stored in a variable, or, reassign new values to the variable. * there are additional rules governing where you can access and assign a variable from. Variable declaration syntax (1/3: when you declare a variable, you are proclaiming Henceforth, the identifier shall be bound to a(n) object of stored in memory age: int: the identifier age shall refer to an int value stored in memory. , general form: [identifier]: [type: the type can be: int, float, str, bool (and many more types to come!) Variable names are an example of an identifier.

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