100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4.2 TrustPilot
logo-home
Examen

CPEN 333 – Midterm Exam Questions with 100% Correct Answers 2024

Puntuación
-
Vendido
-
Páginas
17
Grado
A+
Subido en
20-03-2024
Escrito en
2023/2024

CPEN 333 – Midterm Exam Questions with 100% Correct Answers 2024 What is an Operating System? - answerA program that acts as an intermediary between a user of a computer and the computer hardware, and provides an environment in which a user can execute programs. What are the goals of an Operating System? - answer Execute user programs and make solving user problems easier; Make the computer system convenient to use; Use the computer hardware in an efficient manner. Real-Time System classifications include? - answer Hard real-time systems - task must be serviced by its deadline Soft real-time systems - no definitive guarantee as to when the critical real-time process will be scheduled (system degradation) "Python Fundamentals" Learning Goals - answer Describe the general structure of a python program Declare and use variables Design branching structures (if, if-else, nested if, elif) Design repetition structures (for, while, while-else) Design functions and modules Use built-in functions Python is classified as an _________ language - answerinterpreted To comment multiple lines, we can use three quotes/double quotes called a __________ - answerdocstring (usually used as a first statement in a function, class, module ... as documentation comment.) Ex. """ This function periodically controls the LEDs based on the required pattern.""" Is Python case sensitive? (is x != X ?) - answeryes Python is dynamically typed. What does it mean? - answerThe interpreter type checks at runtime, and the type of a variable is allowed to change over its lifetime. What mechanism helps with readability and allow us to have better type checking (by checkers, IDEs, linters, etc)? - answerType hints Ex. grade: int = 1 text: str = "Excellent" threshold: float = 1.5 But this is just effectively a comment meant for readability. Python doesn't care about it. To indicate a block of code, what does Python require? - answerIndentation Is the following code allowed? for _ in range(3): - answerYes, _ is a general purpose throwaway variable Is there a need for parenthesis for the condition of an if statement? - answerNo, it is optional What keyword do we use to define/create a function/method? - answerdef Examples of functions - answerdef func1() -> None: def func2(a: float, b: float) -> None: print(a,"+",b,"=",a + b) def func3(a: float, b: float) -> float: Arithmetic Operators - answer+ Addition - Subtraction * Multiplication / Division % Modulus ** Exponentiation (important, as it is not ^) // Floor division (important, to ensure result is an integer) What is an identity operator and a membership operator? - answeris = Identity operator (returns True if both are the same object). Ex. x is y in = Membership operator (returns True if the specified value is present in (a member of) the object). Ex. x in y What file does Python put related definitions (functions, classes, variables) into? - answermodule (Ex. math, tkinter, threading, os, socket, ...) We can also create our own module by storing our own function or class definitions in a file (with extension .py) What is the difference between import versus from-import? - answerImport = imports the entire module (Ex. root = tkinter.Tk()) From-import = imports just the specified function, being able to use it without stating the module first (Ex. root = Tk()) (doesn't need tkinter) What is if __name__ == "__main__": ? - answerIf this file is the one being run directly (as opposed to being imported), then run the statements in the if body. __name__ (two underscores preceding and following) is an internal variable that holds the name of the current module. __main__ is the name of the top-level environment of a program, but when a python module is imported, __name__ is set to the module's name. This allows a program to be directly run or be safely imported (or for unit testing purposes). What does a semicolon do in Python? - answerDenotes separation (instead of putting code in a new line; usually not a good style) What does [] indicate? - answerList What does {} indicate? - answerSet or dictionary List initialization examples - answerlist1 = [] # create an empty list list2 = [2,3,4] # create a list with elements 2, 3, 4 list3 = ["red","green"] # create a list with strings list4 = [2,"three",4] # A list can contain mixed types two = list4[0] # stores 2 (element 0 of list4 in two) d(5) # modifies list2 to have 2, 3, 4, 5 Object-Oriented Programming (OOP) Learning Goals - answer Design classes and define objects Use python data types, e.g. list

Mostrar más Leer menos
Institución
CPEN
Grado
CPEN










Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
CPEN
Grado
CPEN

Información del documento

Subido en
20 de marzo de 2024
Número de páginas
17
Escrito en
2023/2024
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

$12.99
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada


Documento también disponible en un lote

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
TheStar Florida State University
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
607
Miembro desde
2 año
Número de seguidores
178
Documentos
24049
Última venta
19 horas hace
Stuvia Prodigy

Tested, Verified and Updated Study Materials with 100% Guaranteed Success.

3.8

121 reseñas

5
58
4
21
3
21
2
4
1
17

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes