100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

CS 1104 Final Study Guide Latest 2023 Graded A+

Rating
-
Sold
-
Pages
8
Grade
A+
Uploaded on
10-11-2023
Written in
2023/2024

CS 1104 Final Study Guide Latest 2023 Graded A+ object consists of some internal data items plus operations that can be performed on that data; more understandable, manageable, and properly-executing program built-ins automatically created by Python, like ints, strings, and functions class used to create a user-defined type of object containing groups of related variables and functions (EX: minutes and seconds in time); groups data and functions to form an object; use initial capitalization for class names attributes maintained by object; determines the data and behavior of the class; a name following a "." symbol instantiation operation performed by "calling" the class, using parentheses like a function call as in my_time = Time() instance created by an instantiation operation; an individual object of the given class; can create multiple instances of a class in a program, with each instance having different attribute values method functions that are also class attributes, can be referenced using dot notation (definition of method example: print_time(self, gmt)) constructor __init__ method, responsible for setting up the initial state of the new instance, single parameter "self" class object factory that creates instance objects class attribute shared amongst all of the instances of that class instance attribute can be unique to each instance, created using dot notation (EX: = 7.5 within a method, or = 7.5 from outside of the class' scope), can be also created/changed from outside the function scope instance object represents a single instance of a class class interface consists of the methods that a programmer calls to create, modify, or access a class instance _Class customization_ process of defining how a class should behave for some common operation; to customize a class, a programmer implements instance methods with special method names (EX: operator overloading) Rich Comparison Methods (6) __lt__(self, other) = less-than () __ge__(self, other) = greater-than or equal-to (=) __ne__(self, other) = not-equal to (!=) isinstance() function returns a True or False Boolean depending on whether a given variable matches a given type Methods for emulating numeric types __add__(self, other) = Add (+) memory allocation The process of an application requesting and being granted memory (All variables/objects in a Python application reside in allocated memory. An application cannot use memory that has not been allocated.) reference count an integer counter that represents how many variables reference an object; Python's garbage collector will deallocate objects with a reference count of 0 Error-checking code code that a programmer introduces to detect and handle errors that may occur while the program executes exception handling handling exceptional conditions (errors during execution); try and except constructs Multiple exception handlers can be added to a try block by adding additional except blocks and specifying the specific type of exception that each except block handles (for many types of errors) raise statement causes immediate exit from the try block and the execution of an exception handler finally clause of a try statement allows a programmer to specify clean-up actions that are always executed; always the last code executed before the try block finishes custom exception type usually defined by inheriting from the Exception class; not a function; usually end with error script file as input to the interpreter module a file containing Python code that can be imported and used by scripts, other modules, or the interactive interpreter; filename should end with ".py" (EX: filename = HTTP.py - import HTTP) dependency a module being required by another program module object a namespace that contains definitions from the module the importing process 1. es checked for HTTPServer 2. Module object created 3. HTTPServer added to es 4. HTTPServer code executed 5. HTTPServer added to importer's namespace from used to specify names to import from a module (EX: Import specific name from a module = from HTTPServer import address) __name__ global string variable automatically added to every module that contains the name of the module if __name__ == "__main__" if true, then the file is being executed as a script and the branch is taken. Otherwise, the file was imported and thus __name__ is equal to the module name reload() function can be used to reload and re-execute the changed module package directory that, when imported, gives access to all of the modules stored in the directory; must include a file called __init_.py open() function gets input from a file Iterating over each line of a file for ... in syntax () method writes a string argument to a file; Output is buffered, thus there may be a delay between calling the write method and data being written to the disk functions (path) - Splits a path into a 2-tuple (head, tail) s(path) - Returns True if path exists, else returns False e(path) - Returns True if path is an existing file, and false otherwise ze(path) - Returns the size in bytes of path () use when searching for specific files within a directory tree, and the exact path is unknown with statement used to open a file, execute a block of statements, and automatically close the file when complete comma separated values simple text-based file format that uses commas to separate data items, called fields derived class class that inherits the class attributes of another class, known as a base class, is-a relationship _multiple inheritance_ class can inherit from more than one base class _mixins_. classes that provide some additional behavior, by "mixin in" new methods, but are not themselves meant to be instantiated unit testing testing the individual components of a program (such as specific methods, class interfaces, data structures); unittest module

Show more Read less
Institution
CS 1104
Course
CS 1104









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
CS 1104
Course
CS 1104

Document information

Uploaded on
November 10, 2023
Number of pages
8
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
StellarScores Western Governers University
View profile
Follow You need to be logged in order to follow users or courses
Sold
1947
Member since
2 year
Number of followers
867
Documents
21200
Last sold
1 day ago
Your Academic Hub: Documents, Study Guides, Summaries, Essays, and Exclusive Package Deals.

Welcome to my comprehensive academic resource store! At my online hub, I offer a vast array of meticulously crafted documents, study guides, summaries, and essays to support your educational journey. I understand the value of accuracy and completeness, which is why all my materials are verified and kept up-to-date with the latest versions. But that's not all! I also offer exclusive package deals and bundles to provide you with cost-effective solutions for your academic needs. Whether you're a student looking for study aids or seeking in-depth knowledge, my store is your one-stop destination for reliable, top-quality materials that can propel your learning experience to new heights. Explore my offerings and unlock the keys to academic success today!

Read more Read less
4.0

456 reviews

5
249
4
81
3
63
2
24
1
39

Trending documents

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions