deck 1 Flashcards

1
Q

what are strings

A

are sequences of characters enclosed in single or double quotes
you can preform various operations on strings such as slicing and concatenation

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

wat can you assign to variables

A

value

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

what types of data can variables hold

A

numbers, strings or lists

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

what are lists

A

collections of data in a single order

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

what can you do to lists

A

add, remove or modify items within them

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

what are loops

A

they are used to repeat blocks of code

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

what are the two different types of loops

A

for loops and while loops

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

what are if statements used for

A

to make decisions in code

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

what are functions

A

blocks of reusable code

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

how are function blocks defined

A

using the def keyword

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

what is a random module

A

generates random numbers or choices

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

what are some common python errors

A

syntax errors
indentation error

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

what happens when you add lists together

A

they simply go next to each other like

[1,2,3] + [4,5,6]
is
[1,2,3,4,5,6]

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

what does a try-except block do

A

its used to catch and handle exceptions or errors without stopping the program

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

what does [0] mean

A

the first character of a string

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