CSE 1010 Lecture Notes - Lecture 4: George Boole

35 views3 pages
jadetortoise401 and 55 others unlocked
CSE 1010 Full Course Notes
84
CSE 1010 Full Course Notes
Verified Note
84 documents

Document Summary

Python does not require you to pre-define what type can be associated with a variable. What type a variable holds can change. A type in python essentially defines two things. 123l ( l suffix means any length, but potentially very slow. Python will convert if an integer gets too long automatically) A character 1" is not the integer 1. You need to convert the value returned by the input command (characters to an integer) Type conversion int(some_var) returns an integer float(some_var) returns a float str(some_var) returns a string int(2. 1) 2 int( 2") 2 int( 2. 1") fail because it"s a double conversion str(2) 2" str( 2. 0") 2. 0". It is a way to store more than one value in a variable. It is a way to associate values together. Lists are indexed by using a 0-based subscript. The subscript -1 refers to the last element of the list. 2 is the next to last and so on.

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

Related Questions