Docsity

short questions about, Schemes and Mind Maps of Computer science

Toggle sidebar
bg1
Variables & Constants
1. Which of the following is a constant by Python convention?
A) radius
B) Pi
C) PI
D) area
Answer: C) PI
2. What is a variable in a program?
A) A value that never changes
B) A named data store whose value can change
C) Always a number
D) Only used for input
Answer: B) A named data store whose value can change
3. Which of these is a correct way to declare multiple constants in Python?
A) CONST1, CONST2 = 5, 10
B) CONST1 = 5 CONST2 = 10
C) const CONST1, CONST2 = 5, 10
D) Dim CONST1, CONST2 As Integer
Answer: A) CONST1, CONST2 = 5, 10
4. Why should variable and constant names be meaningful?
A) To confuse the user
B) To make programs readable and maintainable
C) To make programs run faster
D) Python requires it
Answer: B) To make programs readable and maintainable
Data Types
5. Which of these is a Boolean data type in Python?
A) True
B) "True"
pf3
pf4

Partial preview of the text

Download short questions about and more Schemes and Mind Maps Computer science in PDF only on Docsity!

Variables & Constants

1. Which of the following is a constant by Python convention?

A) radius B) Pi C) PI D) area Answer: C) PI

2. What is a variable in a program?

A) A value that never changes B) A named data store whose value can change C) Always a number D) Only used for input Answer: B) A named data store whose value can change

3. Which of these is a correct way to declare multiple constants in Python?

A) CONST1, CONST2 = 5, 10

B) CONST1 = 5 CONST2 = 10

C) const CONST1, CONST2 = 5, 10 D) Dim CONST1, CONST2 As Integer Answer: A) CONST1, CONST2 = 5, 10

4. Why should variable and constant names be meaningful?

A) To confuse the user B) To make programs readable and maintainable C) To make programs run faster D) Python requires it Answer: B) To make programs readable and maintainable

Data Types

5. Which of these is a Boolean data type in Python?

A) True B) "True"

C) 1

D) None Answer: A) True

6. Which data type is used for decimal numbers?

A) int B) str C) float D) bool Answer: C) float

7. Which data type would you use for storing a single character?

A) int B) char C) str D) float Answer: C) str (Python does not have a separate char type; single characters are strings)

8. What is the correct data type for storing a student’s name?

A) int B) float C) str D) bool Answer: C) str

9. Which of the following is an integer?

A) 12

B) 12.

C) "12"

D) True Answer: A) 12

Input/Output

Answer: A) print("Score", score)