1) A(n) ______ is a step-by-step process designed to solve a problem or perform a computation. a) Algorithm b) Function c) Operator d) Debugging 2) A ______ is an error in a program that causes it to produce incorrect results. a) Exception b) Debugging c) Bug d) Syntax Error 3) A ______ language is designed to be easy for computers to execute, also known as machine language. a) High-level b) Low-level c) Assembly d) Scripting 4) The ______ operator (%) returns the remainder of a division operation. a) Division b) Floor Division c) Modulus d) Exponentiation 5) A ______ is a named sequence of statements that performs a specific task in a program. a) Variable b) Function c) Module d) Condition 6) Which of the following is a reserved word in Python that cannot be used as a variable name? a) print b) def c) variable d) program 7) What is the correct term for a special value that a function returns? a) Local variable b) Return value c) Argument d) None 8) What type of error causes a program to run but produces unintended results? a) Syntax error b) Semantic error c) Exception d) Debugging 9) In Python, if, else, and elif are examples of: a) Functions b) Logical operators c) Conditional statements d) Loops 10) What is the correct term for the // operator in Python? a) Modulus operator b) Floor division c) Integer division d) Recursion 11) A function in Python must always return a value. a) True b) False 12) In Python, indentation is optional. a) True b) False 13) Boolean expressions always evaluate to either True or False. a) True b) False 14) A recursive function is one that calls itself. a) True b) False 15) The import statement is used to delete a function from memory. a) True b) False 16) A ______ is a graphical representation of variables and their values. a) State diagram b) Flowchart c) Debugger d) Function map 17) A ______ is a value that a function receives when it is called. a) Return value b) Argument c) Parameter d) Operand 18) A ______ is an error in a program that makes it impossible to parse and execute. a) Semantic error b) Exception c) Syntax error d) Debugging 19) A ______ is a special value that a function returns when there is no explicit return statement. a) False b) None c) Zero d) Empty 20) The ______ function is used to display output in Python. a) show() b) echo() c) print() d) display() 21) What is the purpose of the return statement in a function? a) To terminate the function immediately and return a value b) To print a value to the screen c) To call another function d) To pause execution 22) Which statement is used to include external Python modules? a) include b) load c) import d) require 23) What is the correct term for using a function inside another function? a) Nesting b) Composition c) Encapsulation d) Abstraction 24) What is the value of 5 % 2 in Python? a) 2 b) 1 c) 5 d) 0 25) Which of the following is not a built-in Python data type? a) Integer b) Float c) Boolean d) Character 26) What will print(type(42.0)) output? a) <class 'float'> b) <class 'int'> c) <class 'str'> d) <class 'bool'> 27) What is the correct term for a function that calls itself? a) Recursive function b) Loop function c) Debugging function d) Infinite function 28) What does the not operator do in Python? a) Repeats an action b) Returns the opposite of a Boolean value c) Joins two Boolean expressions d) Adds two numbers 29) The += operator can be used to update the value of a variable by adding to it. a) True b) False 30) The input() function in Python is used to get user input as an integer. a) True b) False
0%
UotP Foundations to Programming Ch. 1-6 Terms
共享
共享
共享
由
Funlingua
12th Grade
Higher Education
Adults
Computing
Computer Science
vocabulary
编辑内容
打印
嵌入
更多
作业
排行榜
显示更多
显示更少
此排行榜当前是私人享有。单击
,共享
使其公开。
资源所有者已禁用此排行榜。
此排行榜被禁用,因为您的选择与资源所有者不同。
还原选项
随堂测验
是一个开放式模板。它不会为排行榜生成分数。
需要登录
视觉风格
字体
需要订阅
选项
切换模板
显示所有
播放活动时将显示更多格式。
打开成绩
复制链接
QR 代码
删除
恢复自动保存:
?