proffreda

Python Quiz Week 3

Jun 22nd, 2016
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. CS2021 
Quiz for Week 3
  2.  
  3. What are the two ways to run python?
  4.  
  5. What is a REPL?
  6.  
  7. What is a python module?
  8.  
  9. In a module what is the purpose of an if statement
  10. if __name__ == '__main__’:
  11.  
  12. Where do we find the search path for modules?
  13.  
  14. How do you find all the names defined by a module?
  15.  
  16. What is a package?
  17.  
  18. How do you find a description of package contents?
  19.  
  20. How do you change the working directory in program?
  21.  
  22. How do you change the search path in program?
  23.  
  24. When python detects an error, what is the Traceback that is printed?
  25.  
  26. What is an assert statement and how can it be used to debug program?
  27.  
  28. What is the difference between absolute and relative filenames?
  29.  
  30. Is “../lectures/file_io.pptx” a relative or absolute filename?
  31.  
  32. T/F
  33. If you open a file for writing it destroys the existing contents?
  34. T/F
  35. A file that is opened can be read multiple times?
  36. T/F
  37. An absolute filename is better choice since it does not depend on current directory?
Add Comment
Please, Sign In to add comment