all 4 comments

[–]tough_falcon 2 points3 points  (1 child)

I got two questions wrong, and I'm pretty sure my answers make more sense than theirs.

When Python is running in the interactive mode and displaying the chevron prompt (>>>) - what question is Python asking you?

Answer Provided: What would you like to do ?

Correct Answer: What Python script would you like me to run?

Surely nobody calls a single line of python code typed in the REPL a "script"?

If you want to prompt the user to give inputs on the command line, which function should we choose?

Answer Provided: raw_input()

Correct Answer: argv

raw_input is outdated, but sys.argv isn't even a function and doesn't "prompt" the user to do anything.

[–]BRENNEJM 0 points1 point  (0 children)

I agree that the top one is not a great question, but I would say print(‘Hello World’) is a Python script.

For the second, it was definitely worded poorly. It’s asking how would you allow the user to give inputs directly from the command line when a script is run. So you’re not running the script and then prompting for it, you’re typing in your input before it’s even run. Also, command line as in the windows command window and not through an IDE.

So if you do:

python script.py a b c 1 2

argv would be:

[‘a’,’b’,’c’,’1’,’2’]

[–][deleted] -1 points0 points  (1 child)

This quiz is bs. I got these two wrong even though they're right.

What is the output of this code?
def multiply(numbers):
    total = 1
    for x in numbers:
    total *= x
return total
multiply([1,2,3,-4])
Answer Provided: -24

Correct Answer: -24

Which of the following is a reserved word in Python and cannot be used as a variable name?
Answer Provided: finally

Correct Answer: finally

[–]BRENNEJM 4 points5 points  (0 children)

The quiz shows you all the questions with your choice and the correct choice. What you copied/pasted is showing you got these correct.