Zybooks L4 Flashcards

1
Q

variable_name[3]

A

output will be 3rd index number of the variable value

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

len(variable)

A

output is the amount of characters of the value of the variable

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

string

A

sequence of characters (can be one letter)

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

string concatenation

A

using + to create a new string between two existing strings

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

Formatted string literals (f-strings)

A

output includes expressions, such as variables or other calculations, as part of the output text.

number = 6
amount = 32

print(f’{number} burritos cost ${amount}’)
6 burritos cost $32

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

list

A

container created by surrounding a sequence of variables or literals with brackets [ ]. Ex: my_list = [10, ‘abc’] creates a new list
- list item - element

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

updating list elements

A

my_nums = [5, 12, 20]
print(my_nums)

Update a list element
my_nums[1] = -28
print(my_nums)

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