Comp 110 Exam Questions With Correct
Answers A+
What type of value does the input function always result in? - Answer✔str
The generic format of a variable declaration and initialization statement is the following:
A: B = C
What is A? - Answer✔The name of the variable being declared
The generic format of a variable declaration and initialization statement is the following:
A: B = C
What is B? - Answer✔The data type of the variable being declared
The generic format of a variable declaration and initialization statement is the following:
A: B = C
What is C? - Answer✔The initial value of the variable being declared
What does the final type function call evaluation tonic this sequence of statements?
>>> course: str = "110"
>>> type(int(course)) - Answer✔int
What is the type of true? - Answer✔<class 'bool'>
What is the evaluation of: 10/2 - Answer✔5.0
Given the string "12345", what is the evaluation of:
"12345" [0] - Answer✔'1'
What is the evaluation of:
"spooky season" [2 + 2] - Answer✔'k'
Assuming the evaluation of Len("spooky") is 6, what is the evaluation of:
"spooky"[len("spooky")] - Answer✔Error: string index out of range
When will you use bool values in your programs? - Answer✔When making logical decisions