Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Which is NOT a characteristic of good computer programs? A. Concise. B. Sufficiently-explicit. C. Legible and well-organized. D. Expect computers to make assumptions. E.

1. Which is NOT a characteristic of good computer programs? A. Concise. B. Sufficiently-explicit. C. Legible and well-organized. D. Expect computers to make assumptions. E. All of the above are characteristics of good computer programs. F. Good computer programs provide explicit instructions, not high-level instructions. 2. What is an interpreted language? A. A programming language that requires code to be translated to English before being run. B. A programming language that requires code to be translated from human language to machine code while running the program. C. A programming language that requires that code to be translated from human language to machine code before running the program. D. A programming language that requires machine code be translated into human language prior to running. E. A programming language that requires machine code be translated into human language while running. 3. What are the benefits of a compiled language? A. It runs faster. B. It is easier to edit for bugs. C. It needs to be converted to machine code before running. D. It doesn't need to be converted to machine code before running. E. It is compressed, so it contains fewer lines. 4. What is a pseudocode? A. Code that has been compiled for a compiled language. B. Code after it has been run. C. Shorthand code written in Python. D. A human-language version of code that describes steps and logic E. Programming code that is ready to be executed. 5. Comments are helpful to A. Writers of code and the Python interpreter. B. Readers of code and the Python interpreter. C. Writers and readers of code. D. Writers of code, readers of code, and the Python interpreter. E. None of the above 6. In computer programming, a variable is? A. A value that changes each time a program runs. B. A fixed placeholder in the code that can be assigned a value. C. An uncertainty that cannot be determined in advance. D. A description of the variance across different user's hardware and operating systems. E. An instruction left for the computer to decide how to interpret. 7. When naming variables, it's best practice to? A. Use the letters x, y and z. B. Use variable names that make sense to the Python interpreter. C. Use variable names that make sense to writers and readers of code. D. Use the same variable names as were used before to overwrite variables. E. Start variables with a capital letter. 8. Which of the following is an acceptable name for a variable that holds a user's first name? A. firstName B. first name C. 1stName D. lastName E. FirstName 9. A string is A. A variable type that contains integers. B. A variable type that contains decimals. C. A variable type that contains lists of items. D. A variable type that contains words and sentences. E. A variable type that contains true or fales states. 10. A Boolean is A. A variable type that contains integers. B. A variable type that contains decimals. C. A variable type that contains lists of items. D. A variable type that contains words and sentences. E. A variable type that contains true or fales states. 11. Perform the operation as the Python interpreter would: 4*5. A. 1 B. 4 C. 5 D. 9 E. 20 12. Perform the operation as the Python interpreter would: 6 + 12. A. 0.5 B. 6 C. 12 D. 18 E. 72 13. Perform the operation as the Python interpreter would: 4**2 A. 2 B. 4 C. 8 D. 16 E. 32 14. Perform the operation as the Python interpreter would: 16%5 A. 1 B. 2 C. 3 D. 16 E. 80 15. Perform the operation as the Python interpreter would: 16//5 A. 1 B. 2 C. 3 D. 16 E. 80 16. If myString has been assigned the value, "Good morning", what is myString[3]? A. G B. Goo C. d D. Good E. Good morning 17. If myString has been assigned the value, "Good morning", what is len(myString)? A. 1 B. 6 C. 12 D. 15 E. 24 18. Which keyword introduces a conditional statement in Python? A. conditional B. if C. when D. given E. branch 19. What is the result from running the following code? myBool = True if(myBool): print("The statement is true.") print("The statement is false.") A. The code will print, The statement is true. B. The code will print, The statement is false. C. The code will print both, The statement is true and The statement is false. D. The code will not print anything. E. The code will result in an error. 20. What is the result from running the following code? myBool = True if(myBool): print("The statement is true.") else; print("The statement is false.") A. The code will print, The statement is true. B. The code will print, The statement is false. C. The code will print both, The statement is true and The statement is false. D. The code will not print anything. E. The code will result in an error. 21. What is the result from running the following code? myBool = 0 if(myBool): print("The statement is true.") else: print("The statement is false.") A. The code will print, The statement is true. B. The code will print, The statement is false. C. The code will print both, The statement is true and The statement is false. D. The code will not print anything. E. The code will result in an error. 22. What is the result from running the following code? myBool = 1 if(myBool): print("The statement is true.") else: print("The statement is false.") A. The code will print, The statement is true. B. The code will print, The statement is false. C. The code will print both, The statement is true and The statement is false. D. The code will not print anything. E. The code will result in an error. 23. What is the output of the following code if the user inputs "blue"? favoriteColor = input("What's your favorite color?") if(favorite Color == "green"): print("That's my favorite color!") elif(favoriteColor == "blue"): print("I also like that color!") else: print(favoriteColor + " is a good color.") 24. What is the output of the following code if the user inputs "green"? favoriteColor = input("What's your favorite color?") if(favorite Color == "green"): print("That's my favorite color!") elif(favoriteColor == "blue"): print("I also like that color!") else: print(favoriteColor + " is a good color.") A. The program prints, That's my favorite color! B. The program prints, I also like that color! C. The program prints, green is a good color. D. The program doesn't print anything. E. The program has an error 25. What is the output of the following code if the user inputs "red"? favoriteColor = input("What's your favorite color?") if(favoriteColor == "green"): print("That's my favorite color!") elif(favoriteColor == "blue"): print("I also like that color!") else: print(favoriteColor + " is a good color.") A. The program prints, That's my favorite color! B. The program prints, I also like that color! C. The program prints, green is a good color. D. The program doesn't print anything. E. The program has an error 26. A loop is? A. A programming structure that re-runs a section of code a predetermined or undetermined number of times. B. A command that tells the program to start over when it gets to the end. C. A trick that programmers use to skip sections of code that aren't important. D. An iterative process for writing code that involves multiple teams of programmers. E. A piece of software that reviews code to find potential bugs, 27. Which loop is best for when the number of repetitions is unknown? A. A while loop B. A for loop C. A continuous loop D. An infinite loop E. A compound loop 28. How many times will the following for loop run? animal = "monkey" for letter in animal: print(animal) A. 1 B. 3 C. 6 D. 10 E. An infinite number 29. What will the following loop print? animal = "monkey" for letter in animal: print(animal) 30. What will the following loop print? animal = "monkey" for letter in animal: print(letter) 31. How many times will the following while loop run? while(True): print("The loop is true.") A. 1 B. 3 C. 6 D. 10 E. An infinite number

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions