stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Python Var & List Flashcards | StudBud
Explore
/
Python Var & List
Python Var & List
10 terms
·
StudBud Administration
Imported from external platform
Flashcards
10 cards
F
Practice quiz
P
Host live
L
Questions
10
Answers
1
What is the index of the first element in a list?
0
-1
It depends on the list
1
2
Which method is used to add an element to the end of a list?
extend()
add()
insert()
append()
3
How do you declare a variable in Python?
By assigning a value to it
By using the CREATE keyword
By using the DECLARE keyword
By using the VARIABLE keyword
4
How do you create a list in Python?
Using square brackets []
Using parentheses ()
Using curly braces {}
Using the LIST keyword
5
Which of the following is a valid variable name in Python?
myVariable
123variable
my_variable@
my-variable
6
What is a variable in Python?
A keyword used for mathematical operations
A data type used for strings
A container that holds a value
A function used to create loops
7
How can you access the last element of a list?
Both A and B
Using the index -1
Using the index len(list) - 1
None of the above
8
What happens when you try to use a variable that has not been declared?
The program generates a TypeError
The program generates a SyntaxError
The program runs without any errors
The program generates a NameError
9
What is the data type of the variable x after the following statement?
integer
boolean
string
float
10
What is a list in Python?
A function used to create loops
A collection of unordered elements
A collection of ordered elements
A data type used for strings