DevNet Associate DEVASC 200-901 Official Certification Guide by Adrian Iliesiu (z-lib.org)

(andrew) #1
2. Nothing; Python sees it as one big string
3. \n or EoF
4. All of the above



  1. What syntax would you use to open a text file to be
    written to?




  2. data = open("text.txt", "w")




  3. data = load("text.txt", "w")




  4. load("text.txt", "w")




  5. open("text.txt", "w")




  6. Which of the following do you use to write to a CSV
    file in Python?




  7. with open("text.csv", "a") as filehandle:
    csv_writer = csv.write(filehandle)
    csv_writer.writerow(data)




  8. with open("text.csv", "a") as filehandle:
    csv_writer.writerow(data)




  9. with open("text.csv", "a") as filehandle:
    csv_writer = csv.writer(filehandle)
    csv_writer.writerow(data)




  10. with open("text.csv", "a") as filehandle:
    csv_writer = csv.writer(f)
    csv_writer.writerow(data)




  11. Which module is imported to read XML data?




  12. xmlm




  13. xmltodict




  14. XMLParse




  15. None of the above




  16. Which methods are used for converting a native
    JSON file to Python and then back to JSON?
    (Choose two.)




  17. load() and dump()




  18. loads() and dump()




  19. loads() and dumps()




  20. load() and dumps()




  21. What does YAML stand for?




  22. Yet Another Markup Language




  23. YAML Ain’t Markup Language




  24. The name of its creator




  25. None of the above




  26. What is the syntax for error handling in Python?




  27. try-except-else-finally




  28. raise ErrorMessage




  29. assertErrorValue



Free download pdf