stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
PYTHON Flashcards | StudBud
Explore
/
PYTHON
PYTHON
57 terms
·
StudBud Administration
·
5 plays
Imported from external platform
Flashcards
57 cards
F
Practice quiz
P
Host live
L
Questions
57
Answers
1
What type of brackets are used to access elements in a dictionary?
[ ]
( )
< >
{ }
2
What is the result of the following:
Error
[‘Maryam’, ‘Abdulrahman’]
[‘Sara’, ‘Ali’, ‘Noof’, ‘Maryam’, ‘Abdulrahman’]
[‘Sara’, ‘Ali’, ‘Noof’, [‘Maryam’, ‘Abdulrahman’]]
3
What will be the output for the following while loop ?
2468
2 4 6 8 10
end"246810"
Error
4
Mohamad loves soccer and hates playing video games?
False
True
5
What will the value of text be?
‘Need to have Sale’
Error
‘Need to have Sale Restock’
"Restock"
6
What is the output for the following loop?
1 2 3 4 5 6
2 4 6 8 10 12
2 4 6 8 10
1 2 3 4 5
7
Every if statement should include an elif or an else.
True
False
8
Which of the following will return the key and value of a dictionary?
d.fromkeys()
d.items()
d.keys()
d.values()
9
What is the value of ‘price’ in the following code:
Error
650
5.50
50
10
Dictionary keys are unique
False
True
11
What is the value of the key math in the following:
80
76
65
90
12
Data Analysis is not an iterative process.
True
False
13
How to access “Mohamad” in the the following list: instructors = [‘Hajar’, ‘Chris’, ’Mohamad’, ‘Jubran’]
instructor[-1]
instructor["-2"]
instructor[2]
instructors[2]
14
What type of brackets are used to define a list?
[ ]
( )
< >
{ }
15
3.What will print(2 ** 3) output?
9
Error
8
6
16
A dictionary called category with 10 different categories and each key contains a list with 100 products.
8
10
1000
100
17
What is Chris’s favorite Marvel superhero?
Spiderman
Batman
Hulk
Ironman
18
What is the result of the following code:
85
a 15
35
error
19
2.What does list.pop() do?
Removes an element by value
Removes and returns the first element
Deletes the entire list
Removes and returns the last element
20
What will the value of text be?
“ Fail”
“ Honors”
“ Pass”
“ Honors Pass”
21
What is the output of the following code:
[“Red”, “Green”, “Blue”, ”Black”]
[“Red”, “Green”, “Blue”]
[“Red”, “Black”, “Green”, “Blue”, ”Black”]
[“Red”, “Green”, “Blue”, ”Black”]
22
What is wrong with the following code?
room should be surrounded by { }
room has to be cast as string
room and 7 have to be cast as string
room should be concatenated with the text
23
How do you add an element to the end of a list?
list.add(item)
list.insert(item)
list.append(item)
list.pop(item)
24
What is the output of the following function?
Introducing ['firstname'] ['lastname'],['title']!
Introducing firstname:"Mohamed" "lastname":"hindi", "title":"Instructor!
Introducing {["firstname"]} {["lastname"]},{["title"]}!
Introducing Mohamed hindi, Instructor!
25
What is the output of the following function?
error
odd
even
12
26
Which year was oil discovered in Bahrain?
1899
1971
1966
1932
27
What is the result of the following code:
[‘Excel’, ‘Python’, ‘Tableau’, ’PowerBI’]
[‘Excel’, ‘Python’, ‘SQL’, ‘Tableau’, ’SQL’, ’PowerBI’]
[‘Excel’, ‘Python’, ‘Tableau’, ’SQL’, ’PowerBI’]
[‘Excel’, ‘Python’, ’SQL’, ’PowerBI’]
28
The list function .pop() removes a single item a list
True
False
29
What will be the output for the following loop?
2
2.22
1
20
30
which class we are in
406
405
403
404
31
What is the length of random_list?random_list = [0, 1, 2, [3, 4, 5], 6, 7, [8, 9], [10]]
10
8
7
11
32
What is the result of the following code:address = “Manama, Bahrain”print(address[0:6])
"Manam"
"Manama,"
"Manama, "
"Manama"
33
What is the result of the following code:
“Hello everyone!”“Welcome to DAB-7!!!”
“Hello everyone!”“Welcome to {class}!!!”
“Welcome to DAB-7!!!”
Error
34
What is the value of colors:
['blue', 'red', 'pink', 'green', 'brown',['black','gray','yellow']]
['blue', 'red', 'pink', 'green', 'brown']
['black','gray','yellow']
['blue','red','pink']
35
Dictionaries are indexed starting from 0
True
False
36
What is the value of ‘total’:total = (20 + 3 * 2) + 2
23
48
28
27
37
Which village in Bahrain is well known for Cloth Weaving?
Bani Jamra
Muharraq
Jasra
Diraz
38
What is the type of the following variable:quantity = 5.0
float
string
integer
tuple
39
How many forts in Bahrain
3
2
5
4
40
Lists can be modified and can only hold unique values.
False
True
41
How to access the number 5 from the following list:random_list = [10, 11, 2, “[3, 4, 5]”, 6, 7, [8, 3], 5, [2]]
random_list[-2]
random_list[3][-1]
random_list[-1]
random_list[3]
42
You can not perform mathematical operations between an integer and a float.
False
True
43
What is wrong with the following code:
Manama is spelled wrong
Manama is not a key in the dictionary locations
Nothing is wrong
Manama is not in the list
44
What is the output of the following code:
can you replace join!
you can use AI today!
you can leave early today!
today! really you can
45
Which chart is used to track changes over short and long periods of time?
Line
Histogram
Bar
Scatter
46
What are the steps in Data Analysis Workflow:
Frame, Extract, Analysis, Wrangle, Interpret, Communication
Extract, Wrangle, Interpret, Analysis, Communication, Frame
Extract, Frame, Wrangle, Analysis, Interpret, Communication
Frame, Extract, Wrangle, Analysis, Interpret, Communication
47
What is the result of the following code:
Error
30
1040
50
48
4.What is the result of 3**2 == "6" in Python?
False
6
Error
True
49
What is the output for the following loop?
100
10 20 30 40
[10, 20, 30 ,40]
10
50
Summing rates is the correct way to aggregate.
True
False
51
Which all following will add ‘job’ and assign a value to the following list:
player[‘job’] = ‘Data Wizard’
player[job]=’Data Wizard’
player.append(‘Data Wizard’)
[‘job’] = ‘Data Wizard’
52
What is the median of the following dataset [2, 2, 3, 7, 7, 10] ?
5.16
3
5
7
53
What is the mistake in the following code:print(“We are studying “Data Analysis” in room 404)
close the quotation
404 is an integer
None
spelling mistake
54
An if, elif, and else always ends with a :
colon:
identation
paranthesis ( )
semicolon;
55
Characters in a string can be accessed using their index starting from 1?
True
False
56
What will this cell code output?
“Not in List”
“In List”
“Try Again!”
“Not in List” and “Try Again!”
57
What will be the output of the following code?
'Excel', 'PowerBi', 'Tableau'
"Excel'
'PowerBi'
Error