CSC108H5 Lecture Notes - Lecture 3: Computer Data Storage, Substring

121 views6 pages
Verified Note
26 Sep 2018
School
Course
Professor

Document Summary

Variables: a variable is like a container that stores values that you can access or change. Hence, if the variable is an integer we can only save integers in that variable while running our program. In python if we need a variable we simply declare a name and assign a value to it: example: my_variable = 10. Here, the statement does not mean that my_variable is equal to 10. It means that my_variable is set to 10. To increase the value of the variable we can simply give the command: The output of this command should be like: If we want to store a string in a variable we could do it like: Data types: data types include, strings, numbers, booleans, lists, date, time, strings: It is a sequence of unicode characters that may be combination of letters, numbers and special characters. In python, a string is defined in matching single or double quotes.

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