Question Bank

137 questions total.

Last updated Dec. 10th, 2024.


1. Trace the following algorithm and write down the output (if any). What does the algorithm do?

For tracing, assume the input is 10 - 4.

1. Read a 2. Read b 3. Repeat 4-6 until b is 0: 4. let temp = b 5. b = a mod b 6. a = temp 7. Write a

2. Trace the following algorithm and write down the output (if any). What does the algorithm do?

For tracing, assume the input is 13.

1. Read number 2. If number <= 1: 3. Write "No" 4. Else if number == 2: 5. Write "Yes" 6. Else: 7. let i = 2 8. let sqrt = square root of number in integer (whole number) 9. Repeat 10-14 as long as i <= sqrt: 10. let m = number mod i 11. if m == 0: 12. Write "No" 13. Go to line 16 14. increment i 15. Write "Yes" 16. End

3. What's the output of this code?

print ("Hello, world!")
  1. Hello, world!
  2. Error. The code doesn't run.
  3. Code runs but no output.

4. What's the output of this code?

Print("Hello, World!")
  1. Hello, World!
  2. Error. The code doesn't run.
  3. Code runs but no output.

5. What's the output of this code?

print('Hi there, I'm Data!')
  1. Hi there, I'm Data!
  2. Error. The code doesn't run.
  3. Code runs but no output.

6. What's the output of this code?

print("Hi there, I'm Data!")
  1. Hi there, I'm Data!
  2. Error. The code doesn't run.
  3. Code runs but no output.

7. What's the output of this code?

number = 6 print("number is {number}.")
  1. number is 6.
  2. number is {number}.
  3. Error. The code doesn't run.
  4. Code runs but no output.

8. What's the output of this code?

number = 6 print(f"number is {number}.")
  1. number is 6.
  2. number is {number}.
  3. Error. The code doesn't run.
  4. Code runs but no output.

9. What's the output of this code?

def fact(): print("TED talks are highly overrated!")
  1. TED talks are highly overrated!
  2. Error. Code doesn't run.
  3. Code runs but no output.

10. What does the following function return? Choose the best answer.

def yell(): print("yellinggggggggg!")
  1. yellinggggggggg!
  2. None
  3. Nothing
  4. There's syntax error.

11. Assuming we have the following code, which code snippet outputs the desired table:

captain = "Jean-Luc Picard" first_officer = "William Riker" ship_counsellor = "Deanna Troi"

Desired Table:

Captain | First Officer | Ship Counsellor Jean-Luc Picard | William Riker | Deanna Troi
  1. table = f"""\ {'Captain':^16} | {'First Officer':^16} | {'Ship Counsellor':^16} {captain:^16} | {first_officer:^16} | {ship_counsellor:^16} """ print(table)
  2. table = f"""\ {'Captain':<16} | {'First Officer':<16} | {'Ship Counsellor':<16} {captain:<16} | {first_officer:<16} | {ship_counsellor:<16} """ print(table)
  3. table = f"""\ Captain | First Officer | Ship Counsellor {captain} | {first_officer} | {ship_counsellor} """ print(table)

12. What's the output of this code if the input is 15?

number = input("Give me a number: ") half = number // 2 print(f"half of {number} is {half}.")
  1. half of 15 is 7.
  2. half of 15 is 7.5.
  3. Error. The code doesn't run.
  4. Code runs, but no output.

13. What's wrong with the following code and how to fix it?

number = input("Give me a number: ") half = number // 2 print(f"half of {number} is {half}.")

14. According to Python's conventions, which one is a good name for a variable?

  1. largetsNumber
  2. LARGEST_NUMBER
  3. largest_number
  4. LargestNumber

15. According to Python's conventions, which one is a good name for a constant?

  1. gravitational_pull
  2. Gravitational_Pull
  3. GravitationalPull
  4. GRAVITATIONAL_PULL

16. Which one is correct?

  1. We can have constants in Python
  2. Only if we follow the naming rule (all uppercase), we can have constants in Python
  3. Even if we follow the naming rule, we still can't have constants in Python

17. What's the output of the following code?

CONSTANT = 10 CONSTANT = CONSTANT + 1 print(f"{CONSTANT=}")
  1. Error. Code doesn't run
  2. CONSTANT=11
  3. CONSTANT=10
  4. Code runs but no output

18. How to get the last character of a string variable named text? Choose all correct answers.

  1. text[0]
  2. text[-1]
  3. text[len(text)]
  4. text[len(text)-1]

19. Write a Python program that takes a text from the user and prints out the first, middle, and last characters.

Examples:

for Chimichanga:

First character: 'C' - Middle character: 'c' - Last character: 'a'

for Batman:

First character: 'B' - Middle character: 'm' - Last character: 'n'

20. Write a Python program that achieves the previous goal, but now with a function named get_character_at_position that takes two arguments: text and position and returns the character of the text at position position. The output of both programs must be the same.


21. Which of the following is a valid variable name in Python?

  1. 2nd_place
  2. first-place
  3. firstPlace
  4. None

22. Which of the following is NOT a valid Python variable name?

  1. total_sum
  2. class
  3. _variable
  4. myVar

23. Which of the following contains an invalid character for a variable name?

  1. amount_owed
  2. total$amount
  3. _count
  4. var123

24. Which of the following variable names is invalid in Python?

  1. age
  2. Age
  3. AGE
  4. def

25. Which of the following is a valid function name in Python?

  1. 2calculate()
  2. Calculate_sum()
  3. calculate-sum()
  4. def()

26. Which of the following follows Python's recommended convention for naming functions?

  1. calculateArea()
  2. CalculateArea()
  3. calculate_area()

27. Which of the following contains an invalid character for a function name?

  1. get_value()
  2. calculate-sum()
  3. fetchData()
  4. _process()

28. What's true about the following function? Select all correct answers.

def cut_number_in_half(number: int) -> int: return number / 2
  1. It's a void function
  2. It's a value-returning function
  3. Its name follows Python's conventions
  4. Its name does NOT follow Python's conventions
  5. It returns an int as the type hint suggests
  6. It does NOT return an int, producing an error in runtime
  7. It does NOT return an int, but the code runs ok

29. What's the output of the following code for this input: 10 and 2?

number_1 = int(input("Give me a number: ")) number_2 = float(input("Give me another one: ")) mul = number_1 * number_2 print(f"result is {mul} and the type is {type(mul)}.")
  1. result is 20.0 and the type is <class 'float'>.
  2. result is 20 and the type is <class 'int'>.
  3. result is 20.0 and the type is <class 'int'>.
  4. result is 20 and the type is <class 'float'>.

30. What's the output of the following code for this input: 10 and 2?

number_1 = int(input("Give me a number: ")) number_2 = int(input("Give me another one: ")) div = number_1 / number_2 print(f"result is {div} and the type is {type(div)}.")
  1. result is 5.0 and the type is <class 'float'>.
  2. result is 5.0 and the type is <class 'int'>.
  3. result is 5 and the type is <class 'float'>.
  4. result is 5 and the type is <class 'int'>.

31. Which of the following functions are value-returning? Select all correct answers.

  1. int()
  2. print()
  3. type()
  4. input()

32. Which of the following functions are void functions? Select all correct answers.

  1. float()
  2. print()
  3. strip()
  4. replace()

33. Write a Python program that reads a number as the radius and calculates and prints out the area of the circle. Declare PI as a constant with the value of 3.14 in the program. The area must have the precision of 2 digits after the decimal point. No need to use functions.

Example:

Give me the radius: 5 The area of the circle: 78.50
Give me the radius: 6.5 The area of the circle: 132.66

34. Write the same program to calcualte the area of a circle, but now with a function named calculate_circle_area that take the radius and returns the area. The output must be identical to that of the previous problem.


35. Algorithms generally have which of the following? Select all that apply.

  1. Inputs
  2. Outputs
  3. Instructions
  4. Terminal
  5. Graphical User Interface
  6. Purpose

36. Which of the following are optional when it comes to algorithms? Select all that apply.

  1. Inputs
  2. Outputs
  3. Purpose
  4. Instructions

37. Which of the following is NOT a building block of algorithms? Select all that apply.

  1. Loops
  2. Constants
  3. Classes
  4. Functions
  5. Decision
  6. Variables

38. Pseudocode uses building blocks such as Functions.

  1. True
  2. False

39. What does completeness mean in an algorithm? Choose the best answer.

  1. The algorithm finishes successfully
  2. The algorithm works
  3. The algorithm is finite
  4. The algorithm produces correct outputs for all possible inputs

40. What does finiteness mean in an algorithm? Choose the best answer.

  1. The algorithm works
  2. The algorithm stops after a finite number of steps
  3. The algorithm succeeds fast
  4. The algorithm is efficient

41. What does it mean to trace an algorithm?


42. Which one is an example of Non-volatile memory in a computer? Select all that apply.

  1. Hard disk
  2. RAM
  3. Flash Memory
  4. Database

43. Which one is an example of volatile memory in a computer? Select all that apply.

  1. Hard disk
  2. RAM
  3. Flash Memory
  4. Database

44. What does the ALU do in a computer?

  1. Processing inputs
  2. Creating pixels
  3. Doing math and logic
  4. Decoding instructions

45. Which one is not a feature of high level programming languages? Select all that apply.

  1. Easier to read
  2. Slow execution
  3. Closer to the CPU
  4. Fast execution

46. Which one is not a feature of low level programming languages? Select all that apply.

  1. Easier to read
  2. Slow execution
  3. Closer to the CPU
  4. Fast execution

47. Python is a ________ level programming language.

  1. High
  2. Low

48. Assembly is a ________ level programming language.

  1. High
  2. Low

49. Python is a(n) _________ programming language.

  1. Compiled
  2. Interpreted

50. C++ is a(n) _________ programming language.

  1. Compiled
  2. Interpreted

51. Interpreters turn programs into machine code in runtime.

  1. True
  2. False

52. Compilers turn programs into machine code in runtime.

  1. True
  2. False

53. Which functions are among Python's built-in functions? Select all that apply.

  1. print
  2. type
  3. sin
  4. float

54. Which functions are among Python's functions from the standard library? Select all that apply.

  1. print
  2. type
  3. sin
  4. float
  5. sqrt

55. You need to explicitly import functions from the standard library before using them in your program.

  1. True
  2. False

56. You need to explicitly import built-in functions before using them in your program.

  1. True
  2. False

57. Which one is the modulo operator in Python?

  1. /
  2. //
  3. %
  4. \\
  5. **

58. Which one is the exponent operator in Python?

  1. /
  2. //
  3. %
  4. \\
  5. **

59. Which one is the division operator in Python?

  1. /
  2. //
  3. %
  4. \\
  5. **

60. Which one is the integer division operator in Python?

  1. /
  2. //
  3. %
  4. \\
  5. **

61. What is the output of this code?

number = 4 result = number / 2 print(result)
  1. 2
  2. 2.0
  3. Error
  4. No output

62. What is the output of this code?

number = 4 result = number // 2 print(result)
  1. 2
  2. 2.0
  3. Error
  4. No output

63. What is the output of this code?

number = 4 result = number % 2 print(result)
  1. 0
  2. 0.0
  3. Error
  4. No output

64. What is the output of this code?

number = 4.0 result = number % 2 print(result)
  1. 0
  2. 0.0
  3. Error
  4. No output

65. What is the output of this code?

a = 2 b = 3.0 result = a + b print(type(result))
  1. <class 'float'>
  2. <class 'int'>
  3. <class 'bool'>
  4. <class 'str'>
  5. No output
  6. Error

66. What is the output of this code?

a = 2 b = 3 result = a + b print(type(result))
  1. <class 'float'>
  2. <class 'int'>
  3. <class 'bool'>
  4. <class 'str'>
  5. No output
  6. Error

67. What is the output of this code?

a = 2 b = '3' result = a + b print(type(result))
  1. <class 'float'>
  2. <class 'int'>
  3. <class 'bool'>
  4. <class 'str'>
  5. No output
  6. Error

68. What is the output of this code?

a = '2' b = '3' result = a + b print(type(result))
  1. <class 'float'>
  2. <class 'int'>
  3. <class 'bool'>
  4. <class 'str'>
  5. No output
  6. Error

69. What is the output of this code?

a = '2' b = '3' result = a + b print(result)
  1. No output
  2. Error
  3. 5
  4. 23

70. What is the output of this code?

a = True b = '3' result = a + b print(result)
  1. No output
  2. Error
  3. True
  4. 3

71. A variable data type can change in a Python program.

  1. True
  2. False

72. What's the data type of the variable result?

a = 2 b = 3.2 result = a + b
  1. int
  2. float
  3. bool
  4. str

73. What's the data type of the variable result?

a = 2 b = 3.2 result = a - b
  1. int
  2. float
  3. bool
  4. str

74. What's the data type of the variable result?

a = 2 b = 3.2 result = a * b
  1. int
  2. float
  3. bool
  4. str

75. What's the data type of the variable result?

a = 2 b = 3.2 result = a / b
  1. int
  2. float
  3. bool
  4. str

76. What's the data type of the variable result?

a = 2 b = 3.2 result = a // b
  1. int
  2. float
  3. bool
  4. str

77. What's the data type of the variable result?

a = 2 b = 3.2 result = a % b
  1. int
  2. float
  3. bool
  4. str

78. What's the data type of the variable result?

a = 2 b = 3.2 result = b % a
  1. int
  2. float
  3. bool
  4. str

79. What's the data type of the variable result?

a = 2 b = 3.2 result = a ** b
  1. int
  2. float
  3. bool
  4. str

80. What's the data type of the variable result?

a = 2 b = 3.2 result = b ** a
  1. int
  2. float
  3. bool
  4. str

81. What's the output of this program?

a = 2 str_a = str(a) print(type(str_a), str_a)
  1. <class 'str'> 2.0
  2. <class 'str'> 2
  3. <class 'int'> 2.0
  4. <class 'int'> 2
  5. No output
  6. Error

82. What's the output of this program?

a = 2.5 str_a = str(a) print(type(str_a), str_a)
  1. <class 'str'> 2.5
  2. <class 'str'> 2
  3. <class 'float'> 2.5
  4. <class 'float'> 2.0
  5. No output
  6. Error

83. What's the output of this program?

a = "5.5" int_a = int(a) print(type(int_a), int_a)
  1. <class 'int'> 5
  2. <class 'int'> 5.5
  3. <class 'str'> 5
  4. <class 'str'> 5.5
  5. No output
  6. Error

84. What's the output of this program?

a = "5" int_a = int(a) print(type(int_a), int_a)
  1. <class 'int'> 5
  2. <class 'int'> 5.0
  3. <class 'str'> 5
  4. <class 'str'> 5.0
  5. No output
  6. Error

85. What's the output of this program?

a = "5.6" float_a = float(a) print(type(float_a), float_a)
  1. <class 'float'> 5
  2. <class 'float'> 5.6
  3. <class 'str'> 5
  4. <class 'str'> 5.6
  5. No output
  6. Error

86. What's the output of this program?

a = "5.6" result = bool(a) print(type(result), result)
  1. <class 'bool'> True
  2. <class 'bool'> False
  3. No output
  4. Error

87. What's the output of this program?

a = "0.0" result = bool(a) print(type(result), result)
  1. <class 'bool'> True
  2. <class 'bool'> False
  3. No output
  4. Error

88. What's the output of this program?

a = "False" result = bool(a) print(type(result), result)
  1. <class 'bool'> True
  2. <class 'bool'> False
  3. No output
  4. Error

89. What's the output of this program?

a = " " result = bool(a) print(type(result), result)
  1. <class 'bool'> True
  2. <class 'bool'> False
  3. No output
  4. Error

90. What's the output of this program?

a = "" result = bool(a) print(type(result), result)
  1. <class 'bool'> True
  2. <class 'bool'> False
  3. No output
  4. Error

91. Write a Python program that takes a diameter from the input and prints out the area of the circle in 2 digits precision. Example:

Enter diameter: 9.8 Area of the circle: 75.43

92. In the following function definition, how many variables are local to the function scope?

def add_2_numbers(x: float, y: float) -> None: the_sum = x + y print(the_sum)
  1. 0
  2. 1
  3. 2
  4. 3
  5. 4

93. In the following function definition, what do we call x and y?

def add_2_numbers(x: float, y: float) -> None: the_sum = x + y print(the_sum)
  1. Arguments
  2. Parameters
  3. Headers
  4. Type Hints

94. In the following function definition, what do we call float and None?

def add_2_numbers(x: float, y: float) -> None: the_sum = x + y print(the_sum)
  1. Arguments
  2. Parameters
  3. Headers
  4. Type Hints

95. In the following function definition and call, what do we call 2 and 3.5?

def add_2_numbers(x: float, y: float) -> None: the_sum = x + y print(the_sum) add_2_numbers(2, 3.5)
  1. Arguments
  2. Parameters
  3. Headers
  4. Type Hints

96. In the following function definition, what does the function add_2_numbers return?

def add_2_numbers(x: float, y: float) -> None: the_sum = x + y print(the_sum)
  1. float
  2. int
  3. None
  4. str

97. What is the output of this program?

def add_2_numbers(x: float, y: float) -> None: the_sum = x + y print(the_sum) result = add_2_numbers(3, 4.5) print(f"result is {result:.2f}")
  1. 7.5 result is 7.5
  2. 7.5 result is None
  3. Error
  4. No output

98. What is the output of this program?

def add_2_numbers(x: float, y: float) -> None: the_sum = x + y print(the_sum) add_2_numbers(3)
  1. 3
  2. 3.0
  3. Error
  4. No output

99. What is the output of this program?

def add_2_numbers(x: float, y: float) -> None: the_sum = x + y print(the_sum) add_2_numbers()
  1. 0
  2. 0.0
  3. Error
  4. No output

100. In the following code, what do we call the description on line 2?

1. def add_2_numbers(x: float, y: float) -> None: 2. "Adds two numbers" 3. the_sum = x + y 4. print(the_sum)
  1. Documentation
  2. docstring
  3. Function definition
  4. Fundtion body

101. What's the output of the following code?

def subtract(a: int, b: int) -> None: sub = a - b a = 10 b = 12 subtract(a, b) print(f"Result of subtraction is {sub}")
  1. Result of subtraction is -2
  2. Result of subtraction is 2
  3. Error
  4. No output

102. What will be printed when this code segment runs?

count = 4 while count != 0 and count < 10: count -= 1 if count == 2: break print(count)
  1. 0
  2. 1
  3. 2
  4. 3
  5. This is an infinite loop

103. What will be printed when this code segment runs?

num = 7 while num <= 10: if num % 2 == 0: num += 1 else: num -= 2 print(num)
  1. 5
  2. 6
  3. 9
  4. 10
  5. This is an infinite loop

104. What will be printed when this code segment runs?

value = 1 while value < 100: value *= 3 if value > 30: break print(value)
  1. 27
  2. 30
  3. 81
  4. 100
  5. This is an infinite loop

105. What will be printed when this code segment runs?

n = 1 while n != 5: n += 1 if n % 2 == 0: n += 1 print(n)
  1. 4
  2. 5
  3. 6
  4. 7
  5. This is an infinite loop

106. What kind of error this code segment has?

name = "Batman" print(name[0], name[5], name[10])
  1. syntax error
  2. semantic error
  3. run-time error
  4. logic error
  5. no error

107. What kind of error this code segment has?

from math import pi def area(diameter: float) -> float return pi * (diameter / 2) ** 2
  1. syntax error
  2. semantic error
  3. run-time error
  4. logic error
  5. no error

108. What kind of error this code segment has?

def add(a: int, b: int) -> int: return a + b def main() -> None: print("program starts") add(5) print("program ends") main()
  1. syntax error
  2. semantic error
  3. run-time error
  4. logic error
  5. no error

109. What kind of error this code segment could have, assuming the user enters a valid integer?

from math import sqrt def main() -> None: number = int(input("Enter number: ")) result = sqrt(number) print(f"Square root of {number} is {result:.2f}") main()
  1. syntax error
  2. semantic error
  3. run-time error
  4. logic error
  5. no error

110. What kind of error this code segment could have, assuming the user enters valid floats?

def floor_division(a: float, b: float) -> float: return a // b def main() -> None: a = float(input("Enter number 1: ")) b = float(input("Enter number 2: ")) print(f"Floor division of {a} and {b} is {floor_division(a, b):.2f}") main()
  1. syntax error
  2. semantic error
  3. run-time error
  4. logic error
  5. no error

111. What kind of error this code segment could have, assuming the user enters valid integers?

count = 0 number = int(input("Enter a number: ")) while number != -1: num = int(input("Enter a number: ")) count += 1 print(f"You entered the total of {count} numbers")
  1. syntax error
  2. semantic error
  3. run-time error
  4. logic error
  5. no error

112. Implement the pseudocode in question 1 in Python. The algorithm finds the Greatest Common Divisor (GCD) of two integers. Use a while loop.


113. Implement the pseudocode in question 2 in Python. The algorithm prints Yes if the input is a prime number, and No if it's not. Use a while loop and break.


114. What kind of error this code segment could have, assuming the user enters a valid integer?

x = int(input("Enter a number: ")) if x = 2: print("You guessed correctly") else: print("You guessed incorrectly")
  1. syntax error
  2. semantic error
  3. run-time error
  4. logic error
  5. no error

115. For all possible values of x, y, and z, which expression is equivalent to the following? (i.e. they both evaluate to the same value)

not (x != y) and y == z
  1. x < y and y < z
  2. x > y and y >= z
  3. x != y or y == z
  4. x == y or y <= z
  5. x == y and y == z

116. For all possible values of x, y, and z, which expression is equivalent to the following? (i.e.

not (x <= y or y < z)
  1. x < y and y < z
  2. x > y and y >= z
  3. x != y or y == z
  4. x == y or y <= z
  5. x == y and y == z

117. For all possible values of x, y, and z, which expression is equivalent to the following? (i.e.

(y < z or y == z) or x == y
  1. x < y and y < z
  2. x > y and y >= z
  3. x != y or y == z
  4. x == y or y <= z
  5. x == y and y == z

118. For all possible values of x, y, and z, which expression is equivalent to the following? (i.e.

not (x >= y) and not (y >= z)
  1. x < y and y < z
  2. x > y and y >= z
  3. x != y or y == z
  4. x == y or y <= z
  5. x == y and y == z

119. For all possible values of x, y, and z, which expression is equivalent to the following? (i.e.

not (x == y and y != z)
  1. x < y and y < z
  2. x > y and y >= z
  3. x != y or y == z
  4. x == y or y <= z
  5. x == y and y == z

120. What is the output of the following code segment?

def starfleet_rank(points: int) -> str: """Convert points to a Starfleet rank.""" if points >= 50: rank = "Ensign" elif points >= 60: rank = "Lieutenant" elif points >= 70: rank = "Commander" else: rank = "Captain" return rank def main() -> None: print(starfleet_rank(65)) print(starfleet_rank(75)) print(starfleet_rank(85)) main()

121. What is the output of the following code segment?

def starfleet_rank(points: int) -> str: """Convert points to a Starfleet rank.""" if points >= 50: rank = "Ensign" if points >= 60: rank = "Lieutenant" if points >= 70: rank = "Commander" else: rank = "Captain" return rank def main() -> None: print(starfleet_rank(55)) print(starfleet_rank(75)) print(starfleet_rank(85)) main()

122. What is the output of the following code segment?

a = [1, 2, 3] b = a b.append(4) print(a, b)

123. What is the output of the following code segment?

a = 5 b = a b += 1 print(a, b)

124. What is the output of the following code segment?

def some_func(param: list) -> None: param.append(5 + 6) def main() -> None: my_list = list(range(5)) some_func(my_list) print(my_list) main()

125. What is the output of the following code segment?

a = [1, 2, 3] b = a b = list(range(5)) b.append(4) print(a, b)

126. What is the output of the following code segment?

a = [1, 2, 3] b = a b = list(range(5)) print(id(a) == id(b))

127. What is the output of the following code segment?

a = [1, 2, 3] b = a b.reverse() print(id(a) == id(b))

128. What is the output of the following code segment?

def some_func(param: list) -> int: param.append(5 + 6) return id(param) def main() -> None: my_list = list(range(5)) ref = some_func(my_list) print(id(my_list) == ref) main()

129. What is the output of the following code segment?

def some_func(param: list) -> int: param = [1] return id(param) def main() -> None: my_list = list(range(5)) ref = some_func(my_list) print(id(my_list) == ref) main()

130. What is the output of the following code segment?

name = "batman" name.upper() print(name)

131. What is the output of the following code segment?

name = "batman" name = name.upper() print(name)

132. What is the output of the following code segment?

name = "batman" ref_1 = id(name) name = name.upper() ref_2 = id(name) print(ref_1 == ref_2)

133. What is the output of the following code segment?

name = "batman" name[0] = "B" print(name)

134. What is the output of the following code segment?

def some_func(param: str) -> None: param += "..." def main() -> None: text = "to be continued" some_func(text) print(text) main()

135. What is the output of the following code segment?

def some_func(param: str) -> str: param += "..." return param def main() -> None: text = "to be continued" text = some_func(text) print(text) main()

136. What is the output of the following code segment?

def some_func(param: str) -> int: param += "..." return id(param) def main() -> None: text = "to be continued" ref = some_func(text) print(id(text) == ref) main()

137. What is the output of the following code segment?

def some_func(param: int) -> None: param += 5 def main() -> None: param = 5 some_func(param) print(param) main()