Unit 2
No description yet. This curated deck is ready for daily study.
Card preview (4)
What are the data structure table column names?
• field name • keyfield • data type • field length • validation
What requirements could there be in a given scenario?
• interface: would a GUI or CLI be more suitable? • data structures: Would arrays (short term) or files (long term) be more suitable for storing the data needed? • file handling: How should the files be stored? Serially? • validation: what fields can you apply what validation techniques to? Specific fields? • variables: what are the advantages and disadvantages of local and global variables? • data types: How would the user input each data type? remember to be specific to the scenario and the programming language (python)
How do you open a file in python?
file = open(“filename.txt”)
What parameters can be passed into the “open()” function?
• “x” creates the file • “r” opens the file for read only • “w” overwrites the file • “a” adds to the end of the file • “r+” reads and overwrites • “a+” reads and adds to a file