PRP201c FE Computer science Exam With Complete Questions and Answers
PRP201c FE 1. When Python is running in the interactive mode and displaying the chevron prompt (>>>) - what question is Python asking you? A. What Python script would you like me to run? B. What is your favourite color? C. What would you like to do? D. What is the next machine language instruction to run? - correct answer C 2. What will the following program print out: >>> x = 15 >>> x = x + 5 >>> print(x) A. 20 B. 5 C. 15 D. "print x" E. x + 5 - correct answer A 3. Python scripts (files) have names that end with: A) .py B) .exe C) .png D) .doc - correct answer A 4. Which of these words is a reserved word in Python ? A. while B. payroll C. names D. pizza - correct answer A 5. What is the proper way to say "good-bye" to Python? A. while B. // stop C. #EXIT D. quit() - correct answer D 6. Which of the parts of a computer actually executes the program instructions? A. Main Memory B. Central Processing Unit C. Input/Output Devices D. Secondary Memory - correct answer B 7. What is "code" in the context of this course? A. A password we use to unlock Python features B. A sequence of instructions in a programming language C. A way to encrypt data during World War II D. A set of rules that govern the style of programs - correct answer B 8. A USB memory stick is an example of which of the following components of computer architecture? A. Central Processing Unit B. Main Memory C. Output Device D. Secondary Memory - correct answer D 9. What is the best way to think about a "Syntax Error" while programming? A. The computer is overheating and just wants you to stop to let it cool down B. The computer has used GPS to find your location and hates everyone from your town C. The computer did not understand the statement that you entered D. The computer needs to have its software upgraded - correct answer C 10. Which of the following is not one of the programming patterns covered in Chapter 1? A. Random steps B. Sequential Steps C. Conditional Steps D. Repeated Steps - correct answer A 11. Which of the following is a comment in Python? A. // This is a test B. * This is a test C. /** This is a test **/ D. # This is a test - correct answer D 12. What does the following code print out? print("123" + "abc") A. 123+abc B. This is a syntax error because you cannot add strings C. 123abc D. hello world - correct answer C 13. Which of the following variables is the "most mnemonic"? A. x B. x1q3z9ocd C. hours D. variable_173 - correct answer C 14. Which of the following is not a Python reserved word? A. spam B. break C. continue D. for - correct answer A 15. Assume the variable x has been initialized to an integer value (e.g., x = 3). What does the following statement do? x = x + 2 A. Create a function called "x" and put the value 2 in the function B. Produce the value "false" because "x" can never equal "x+2" C. This would fail as it is a syntax error D. Retrieve the current value for x, add two to it and put the sum back into x - correct answer D 16. Which of the following elements of a mathematical expression in Python is evaluated first? A. Addition + B. Subtraction - C. Parentheses ( ) D. Multiplication * - correct answer C 17. What is the value of the following expression 42 % 10 Hint - the "%" is the remainder operator A. 4210 B. 2 C. 0.42 D. 10 - correct answer B 18. What will be the value of x after the following statement executes: x = 1 + 2 * 3 - 8 / 4 A. 2.0 B. 5.0 C. 8 D. 4 - correct answer B 19. What will be the value of x when the following statement is executed: x = int(98.6) A. 98 B. 6 C. 100 D. 99 - correct answer A 20. What does the Python input() function do? A. Pause the program and read data from the user B. Connect to the network and retrieve a web page. C. Read the memory of the running program D. Take a screen shot from an area of the screen - correct answer A 21. What do we do to a Python statement that is immediately after an if statement to indicate that the statement is to be executed only when the if statement is true? A. Indent the line below the if statement B. Underline all of the conditional code C. Start the statement with a "#" character D. Begin the statement with a curly brace { - correct answer A.......................................................................
École, étude et sujet
- Établissement
- Somerset Community College
- Cours
- PRP201c FE (PRP201CFE)
Infos sur le Document
- Publié le
- 8 décembre 2022
- Nombre de pages
- 50
- Écrit en
- 2022/2023
- Type
- Examen
- Contient
- Questions et réponses
Sujets
-
prp201c fe
-
prp201c fe computer science exam
-
prp201c fe computer science exam with complete questions and answers
-
when python is running in the interactive mode and displaying the chevron prompt gt