11. The Python library we used to plot the chart in the lab is

  • Pandas
  • Plotly
  • MatPlotLib
  • PyCoinGecko

Final Exam

12. When slicing in Python what does the “0” in this statement [0:2] specify?

  • It specifies the position to start the slice
  • It specifies the step of the slicing
  • It specifies the position to end the slice

13. If var = “01234567” what Python statement would print out only the odd elements?

  • print(var[1::2])
  • print(var[3::1])
  • print(var[2::2])

14. Consider the string Name=”EMILY”, what statement would return the index of 0?

  • Name.find(“E”)
  • Name.find(“L”)
  • Name.find(“I”)

15. In Python what data type is used to represent text and not numbers?

  • int
  • str
  • float

16. What is the result of the following code segment: int(3.99)

  • 3
  • 3.99
  • 4

17. What following code segment would produce an output of “0.5”?

  • 1/2
  • 1//2

18. In Python 3 what following code segment will produce an int?

  • 2//3
  • 1/2

Shuffle Q/A 2

19. How many identical keys can a dictionary have ?

  • 100000000
  • 0
  • 3

20. What does the index of “1” correspond to in a list or tuple?

  • the third
  • The first element
  • The second element

Leave a Reply