Practice Quiz: Running Python Locally

6. When your IDE automatically creates an indent for you, this is known as what?

  • Interpreted language
  • Syntax highlighting
  • Code reuse
  • Code completion

7. Can you identify the error in the following code?

#!/usr/bin/env python3
import numpy as np

def numpyArray():
x = np.array([[1, 2, 3], [4, 5, 6]], np.int32)
y = numpy.array([[3, 6, 2], [9, 12, 8]], np.int32)
return x*y
print(numpyArray())

  • The y variable is not calling the numpy module properly.
  • The function is not indented properly.
  • The shebang line is not necessary.
  • numpy is not imported correctly because as is used.

8. Which type of programming language is read and converted to machine code before runtime, allowing for more efficient code?

  • Object-oriented language
  • Compiled language
  • Interpreted language
  • Intermediate code

9. Which of the following is not an IDE or code editor?

  • Eclipse
  • pip
  • Atom
  • PyCharm

10. What does the PATH variable do?

  • Tells the operating system where to find executables
  • Returns the current working directory
  • Holds the command line arguments of your Python program in a list
  • Tells the operating system where to cache frequently used files

Devendra Kumar

Project Management Apprentice at Google

Leave a Reply