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

UotP Foundations to Programming Ch. 1-6 Terms

लीडरबोर्ड

दृश्य शैली

विकल्प

टेम्पलेट स्विच करें

ऑटो-सेव पुनःस्थापित करें: ?