stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Python #2 - Summer 2024 Flashcards | StudBud
Explore
/
Python #2 - Summer 2024
Python #2 - Summer 2024
10 terms
·
StudBud Administration
·
7 plays
Imported from external platform
Flashcards
10 cards
F
Practice quiz
P
Host live
L
Questions
10
Answers
1
What is the data type of the variable y in the following code: y = "Hello"?
Boolean
String
Integer
Float
2
What is the output of the following code: print(5 / 2)?
2.0
1.5
1.0
2.5
3
What is the purpose of the print() function in Python?
To calculate mathematical operations
To store data in a variable
To display output on the screen
To ask the user for input
4
What is the purpose of the = operator in Python?
To assign a value to a variable
To calculate mathematical operations
To store data in a list
To ask the user for input
5
What is the output of the following code: print(3 * 4)?
15
12
23
324
6
What is the data type of the variable x in the following code: x = 5?
String
Integer
Float
Boolean
7
What is the output of the following code: print("Hello" + " World")
Hello World
Hello
World
Error
8
What is the output of the following code: print(2 ** 3)?
8
10
13
6
9
What is the output of the following code: print("Hello"[0])?
l
o
e
H
10
Create a function in Python that takes two arguments, name and age, and prints their values
def info(name, age):
def display(name, age):
def show(name, age):
def print_info(name, age):