SYSC 1005 Lecture Notes - Lecture 17: Concatenation

51 views2 pages

Document Summary

A list is a type of sequence in python. Six types of sequences in python; a list is one of them. Each element of the list is assigned an index. The index starts off as 0 for position 1, 1 for position 2, and so on. The syntax and notation for a list in python is shown below: ** it is important that you use square brackets to denote a list. Different types of brackets may go into other sequences, such as sets and tuples. You can also access the list by referring to the position of the list, depending on which value you want. ** looking at the list list1[0] would refer to physics list2[1:5] would refer to 2, 3, 4, 5 [starting position:end position] doesn"t include end pos. You can also assign new values to the list. The new list would look like so: [1, 4, 0, 9]

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