stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
LEVEL 1 PYTHON FINAL QUIZ Flashcards | StudBud
Explore
/
LEVEL 1 PYTHON FINAL QUIZ
LEVEL 1 PYTHON FINAL QUIZ
50 terms
·
StudBud Administration
Imported from external platform
Flashcards
50 cards
F
Practice quiz
P
Host live
L
Questions
50
Answers
1
What type of learning is based on reward and punishment?
Unsupervised Learning
Reinforcement Learning
Directive Learning
Supervised Learning
2
In Python, '==' is used for variable assignment.
False
True
3
The expression
not (True and False)
in Python evaluates to False.
False
True
4
What is a key characteristic of unsupervised learning?
Finds patterns in data without labels
Uses labeled data
Focuses on prediction based on known outputs
Requires direct instructions
5
What is the output of this code?
6
5
4
2
6
In the context of AI, what is a "neural network"?
A cybersecurity system designed to protect against AI-driven threats
A process to link various artificial intelligence systems
A database system that stores information in interconnected nodes
A type of algorithm inspired by the structure of the human brain
7
A syntax error occurs when the logic of a program is incorrect.
True
False
8
This will print ["Diana", "Alice", "Bob", "Charlie"]
True
False
9
What is the output of this code?
0
False
True
-5
10
In Pygame, every time we create an image or shape, we specify the coordinates of the TOP RIGHT CORNER
True
False
11
What does the 'print' function do in Python?
Reads input from the user
Performs mathematical calculations
Stores data
Outputs data to the screen
12
In Python, variable names can start with a number.
False
True
13
Pygame is a set of Python modules designed for writing video games.
False
True
14
What is the output of print(2 ** 3) in Python?
8
9
5
6
15
The resemblance theory states that categorization occurs due to similarities and differences in features.
True
False
16
Which module would you use in Python to generate random numbers?
string
random
generatenumbers
math
17
In Python, dictionaries are ordered collections of items.
True
False
18
This will print "Alice"
False
True
19
In Python, the 'input()' function is used to display output to the user.
False
True
20
What is the output of this code?
Error
1
2
3
21
Python's tuple data type is similar to a list but can be modified after it is created.
True
False
22
Runtime errors occur during the writing of a program, not during its execution.
False
True
23
What is a tuple in Python?
A type of Python function
A module for mathematical operations
A mutable sequence of elements
An immutable sequence of elements
24
What is the length of the set 'nums'?
5
6
7
4
25
A dictionary in Python can have two keys with the same name.
False
True
26
What will be the output of this code?
Hello, Alice!
Hello Alice
Hello
Hello, Alice
27
What problem might arise from using prototype theory in categorization?
Difficulty in defining the most salient features
Inability to categorize unique items
Difficulty in finding the best example
All of the above
28
Which statement about functions in Python is incorrect?
Functions can return multiple values
Functions help in code reusability
Functions can only be used once
A function can call other functions
29
This code will print a random integer between 1 and 10.
True
False
30
In Python, 'for' and 'while' are both types of loops.
True
False
31
Which of these is NOT a logical operator in Python?
and
or
not
if
32
The resemblance theory of categorization is based on defining necessary and sufficient conditions.
True
False
33
In Python, elif is used to specify a new condition to test if the previous conditions were False.
True
False
34
What is a key difference between lists and tuples in Python?
Lists are mutable, whereas tuples are immutable.
Tuples can contain more elements than lists.
Lists are faster than tuples.
Tuples are used for arithmetic operations.
35
What is the content of list3?
[1, 2, 3, 4, 5, 6]
[5, 7, 9]
[4, 5, 6]
[1, 2, 3]
36
In supervised learning, the model learns without any labeled training data.
True
False
37
What does the 'range' function do in a loop?
Outputs a range of characters
Determines how many times the loop will run
Calculates the sum of a range of numbers
Stores a range of numbers
38
Which numbers does this code print?
3,3,3
0,1,2
0,1,2,3
1,2,3
39
In Python, a list can store values of different data types.
True
False
40
In Python, what will len({"a": 1, "b": 2, "c": 3}) return?
Error
9
6
3
41
A logical error in Python results in the program not running at all.
False
True
42
What is the output of this code?
7
8
12
9
43
What will be the output of this code?
4
1
3
2
44
Which of these is not a valid Python data type?
List
String
Tuple
Function
45
What will be the output of this code?
False
True
46
What is an example of supervised learning?
A program categorizing emails as spam or not based on previous examples
An algorithm sorting data without any previous training
A neural network discovering patterns in customer data on its own
A chatbot learning to converse by talking to users
47
One difference between syntax errors & logical errors is that syntax errors prevent the program from running at all.
True
False
48
A Python module is a file containing a set of functions and variables defined and implemented by other programmers.
True
False
49
What will this code print?
No
Yes
Error
YesNo
50
What is an example of reinforcement learning?
A neural network classifying images of cats and dogs
A self-driving car algorithm improving through trial and error
An algorithm sorting numbers in ascending order
A program predicting stock market prices