• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 9 páginas
Examen

Python Syntax Exam Study Guide.

Document preview thumbnail
Vista previa 2 fuera de 9 páginas

©SIRJOEL EXAM SOLUTIONS 2024/2025 ALL RIGHTS RESERVED. Python Syntax Exam Study Guide. Indentation - Answersblock (grouping statements, especially when statements are not expressions) - Answersbreaking lines (useful when end-of-line and/or indentation has a special meaning) # - Answerscommenting (until end of line) = = - Answerscomparison min / max - Answerscomparison (min / max (binary or more)) smallest / biggest element cmp - Answerscomparison (returns 3 values (i.e. inferior, equal or superior)) class X: """... """ def x(): """... """ - Answersdocumentation comment Err:510 - Answersequality / inequality (deep) string equality & inequality is / is not - Answersequality / inequality (shallow) ct() - Answersforce garbage collection ( ... ) - Answersgrouping expressions __file__ - Answersinformation about the current line and file eval - Answersruntime evaluation ©SIRJOEL EXAM SOLUTIONS 2024/2025 ALL RIGHTS RESERVED. exec - Answersruntime evaluation case-sensitive - Answerstokens (case-sensitivity (keywords, variable identifiers...)) [_a-zA-Z][_a-zA-Z0-9]* - Answerstokens (variable identifier regexp) CamelCase for classes, underscores for methods - Answerstokens (what is the standard way for scrunching together multiple words) = - Answersvariable assignment or declaration (both) global v1, v2 - Answersvariable assignment or declaration (declaration) al(f, a) - Answerspartial application (in the examples below, a normal call is "f(a,b)") (give the first argument) lambda a, b: ... - Answersanonymous function f(a,b,...) - Answersfunction call f() - Answersfunction call (with no parameter) __getattr__ - Answersfunction called when a function is not defined (in dynamic languages) def f(para1, para2, ...): ... - Answersfunction definition return - Answersfunction return value (breaks the control flow) breaking control flow (returning a value) ()[1] - Answersruntime inspecting the caller information continue / break - Answersbreaking control flow (continue / break) try: a except exn: ... - Answersexception (catching) finally - Answersexception (cleanup: code executed before leaving) raise - Answersexception (throwing) if c: ... - Answersif_then b1 if c else b2 - Answersif_then_else if c: b1 elif c2:

Vista previa del contenido

©SIRJOEL EXAM SOLUTIONS 2024/2025

ALL RIGHTS RESERVED.


Python Syntax Exam Study Guide.

Indentation - Answers✔block (grouping statements, especially when statements are not expressions)

\ - Answers✔breaking lines (useful when end-of-line and/or indentation has a special meaning)

# - Answers✔commenting (until end of line)

< > <= >= - Answers✔comparison

min / max - Answers✔comparison (min / max (binary or more))



smallest / biggest element

cmp - Answers✔comparison (returns 3 values (i.e. inferior, equal or superior))

class X:

"""...

"""

def x():

"""...

""" - Answers✔documentation comment

Err:510 - Answers✔equality / inequality (deep)



string equality & inequality

is / is not - Answers✔equality / inequality (shallow)

gc.collect() - Answers✔force garbage collection

( ... ) - Answers✔grouping expressions

__file__ - Answers✔information about the current line and file

eval - Answers✔runtime evaluation

, ©SIRJOEL EXAM SOLUTIONS 2024/2025

ALL RIGHTS RESERVED.
exec - Answers✔runtime evaluation

case-sensitive - Answers✔tokens (case-sensitivity (keywords, variable identifiers...))

[_a-zA-Z][_a-zA-Z0-9]* - Answers✔tokens (variable identifier regexp)

CamelCase for classes, underscores for methods - Answers✔tokens (what is the standard way for
scrunching together multiple words)

= - Answers✔variable assignment or declaration (both)

global v1, v2 - Answers✔variable assignment or declaration (declaration)

functools.partial(f, a) - Answers✔partial application (in the examples below, a normal call is "f(a,b)")
(give the first argument)

lambda a, b: ... - Answers✔anonymous function

f(a,b,...) - Answers✔function call

f() - Answers✔function call (with no parameter)

__getattr__ - Answers✔function called when a function is not defined (in dynamic languages)

def f(para1, para2, ...): ... - Answers✔function definition

return - Answers✔function return value (breaks the control flow)



breaking control flow (returning a value)

inspect.stack()[1] - Answers✔runtime inspecting the caller information

continue / break - Answers✔breaking control flow (continue / break)

try: a except exn: ... - Answers✔exception (catching)

finally - Answers✔exception (cleanup: code executed before leaving)

raise - Answers✔exception (throwing)

if c: ... - Answers✔if_then

b1 if c else b2 - Answers✔if_then_else

if c:

b1

elif c2:

Información del documento

Subido en
10 de diciembre de 2024
Número de páginas
9
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$10.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

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.
sirjoel
3.6
(20)
Vendido
136
Seguidores
13
Artículos
12750
Última venta
1 mes hace



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