Programming for Network Engineers (PRNE) v2.0 Quiz Questions and Answers

Which of the following is an invalid statement?

Answer :
  • x y z = 1 2 3

What is “Hello”.replace(“l”, “e”)?

Answer :
  • Heeeo

What is the maximum possible length of an identifier?

Answer :
  • 79 characters

Is Python case sensitive when dealing with identifiers?

Answer :
  • TRUE

Which of the following is invalid?

Answer :
  • none of the mentioned

A block of code in Python begins with a __________ and is indented by spaces.

Answer :
  • colon

What type of statement is the following? for device_ip in device_list:

Answer :
  • A loop

Which type of path should be used to open a file based on the working directory of the program?

Answer :
  • Relative

When opening a file, in addition to specifying if the mode is read or write, you can also specify if the file is encoded as text or __________.

Answer :
  • binary

What is output by the following statements? current_version = 1 print(current_version if current_version > 2 else 0)

Answer :
  • 0