Strings and Lists Flashcards

1
Q

Identifier

A

Variable Name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Literals

A

Directly represents a fixed value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

\n

A

Linebreak, newline charactor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

\

A

Escape charactor. Interprets in an alternative way (ignores quotes…etc)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

”””

A

Doesn’t close a string until another set of “””

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Len()

A

Function that shows the number of characters in a string or length of a string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Indexing

A

“Hello”[0] ->’H’. Can be used on strings and lists to access a specific part of them

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Index Operator

A

[]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

range(x, y, z)

A

x= start, y= stop, z= step

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Index Numbers

A

The numerical representation of the positions of elements within a sequence (string or list)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Slice

A

Piece of a string, starting from some position and extending to another position

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Int function

A

Converts a value to an integer ex: int(“3”) = 3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Float function

A

Converts a value into a floating point value ex: float(“34.4”) = 34.4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Predicates

A

Returns true or false to indicate something.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Boolean Statements

A

True and FalseB

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Boolean Operators

A

AND, OR, NOT

17
Q

Sequences

A

Represent a sequence of values. Data type

18
Q

.Append()

A

Adds item/argument as a single item to the end of a list. Only ever adds one item.

19
Q

.Extend()

A

Treats arguments as a sequence and adds each item in the sequence to the end of the list. Adds a sequence of items to a list.

20
Q

.Reverse()

A

Reverses the order of a list (sequence)

21
Q

.Sort()

A

Rearranges the items in a list to their alphabetical order

22
Q

Mutable

A

Changeable

23
Q

Immutable

A

Unchangeable

24
Q

Augmented Assignment

A

Augments the existing value rather than replacing it. EX n += 2 is the same as n = n + 2

25
Q
A