LMU ☀️ CMSI 1010
COMPUTER PROGRAMMING LABORATORY
Quiz 1

Options with circles are single-select (exactly one), while options with squares are multi-select (zero or more).

  1. What are the values in range(2, 8)?
    • 2, 3, 4, 5, 6, 7, 8
    • 2, 3, 4, 5, 6, 7
    • Every value between 2 and 8, including 2.25 and 7.99999
    • There are no values in this range
  2. What do we call a program that interprets commands entered in the terminal?
    • Python
    • Git
    • Shell
    • Task Manager
    • Command Line
  3. What command lists the files in the current folder?
    • mv
    • rm
    • pwd
    • ls
    • cd
  4. How do you move the file named dog that is currently in the folder animals into the folder named canines?
    • ls dog canines/
    • mv dog canines/
    • mv ./dog canines
    • cp dog canines
  5. Which three git commands in order, are the most typical for saving your work to github after changes have been made to work in an existing repository?
    • status, diff, commit
    • add, commit, push
    • add, restore, commit
    • status, merge, commit
    • init, remote, add
  6. What is wrong with the following code?
    age = input("What is your age?")
    if age < 18:
        print("You can't vote yet")
    else:
        print("Wow, you are an adult in the US")
    
    • The indentation is incorrect
    • The code requires apostrophes (') instead of quotation marks (")
    • age is actually a string and cannot be compared with numbers
    • There is no elif part
    • Actually, nothing is wrong
  7. After accepting user input, what two operations should you typically apply to the input?
    • upper and removing all the spaces
    • split and join
    • checking for empty and join
    • strip and join
    • strip and lower
  8. How do you express a dictionary that maps the three countries Colombia, Brazil, and Argentina to their capitals?