• ¿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 4 fuera de 33 páginas
Otro

WGU Python D522 study notes verified to pass 2026/2027

Document preview thumbnail
Vista previa 4 fuera de 33 páginas

WGU Python D522 study notes verified to pass 2026/2027

Vista previa del contenido

WGU Python D522 study notes verified to pass 2026/2027

1. print(10 > 9)
Boolean
print(10 == 9)
print (10 < 9)

2. print(bool("Hel-
Boolean examples of True
lo"))
print(bool("15"))
print(bool(x))

3. print(bool(False))
Boolean examples of False
print( )
print(0)

4. print(isin-
determine if an object is of a certain data type
stance(x, int))

5. int( ) casts an integer from an integer literal, float literal, or string literal

6. float( ) casts a float from an integer literal, a float literal, or a string literal

7. str( ) casts a string from strings, integer literals, or a float literals

8. print("text") outputs text to the console

9. print("text", will end with a space and continue on the same line ("text more text")
end=" ")
print("more
text")

10. print("Wage", comma will print both items with a space between them
wage)

11. print(variable) prints the value of the variable




,WGU Python D522

print("1\n2\n3")print using newline characters

print( )print a blank line

python file.pyrun a script file

15. random function there is no random function, but there is a random module
(import random)

16. for x in "ba- strings are arrays, so this will loop through the characters in "bananas"
nanas":
print(x)

17. variable=input( ) assign text entered by the user to a variable; input is always a string

18. variable = int(in- convert user input into an integer
put)

19. hourly_wage = display text prompt (Enter hourly wage) to request input from user and
int(input("Enter convert to integer
hourly wage: "))

20. print(a.upper( )) display a in console in upper case

21. print(a.lower( )) display a in console as lower case

22. print(a.strip( )) remove whitespace at beginning and end

23. print(a.re- replace a string with another string
place("H", "J"))

24. print(a.split("b")) split string at specified character

25. c=a+b concatenate (combine) two strings
print(c)



, WGU Python D522

26. a=(f"My name
f-string; { } is the placeholder/modifier
is John, I am
{age}")
print(a)

27. a = 85.8756
modifier to format the value to 2 decimal places (85.88)
b = format(a,
".2f")
print(b)

28. price =
f-string with placeholder for price and modifier to format value to 2 decimal
85.87562649
places (Price: $85.88)
b = f"Price:
${price:.2f}"
print(b)

29. What built-in
str
data type is used
x = "Hello, World!"
when you assign
x = str("Hello, World!")
text to your vari-
able?

30. What built-in
int
data type is used
x = 20
when you assign
x = int(20)
a numeric value
to your variable? float
x = 20.5
x = float(20.5)

complex
x = 1j
x = complex(1j)


, WGU Python D522


31. What built-in list
data type is used x = ["apple", "banana", "cherry"]
when you assign x = list(("apple", "banana", "cherry"))
a sequence to
your variable? tuple
x = ("apple", "banana", "cherry")
x = tuple(("apple", "banana", "cherry"))

range
x = range(6)

32. What is the differ- list = collection of values
ence between a list tuple = ordered and unchangeable
and a tuple?

33. What built-in dict
data type is used{"name" : "John", "age" : 36} x =
when you assign dict(name="John", age=36)
a mapping to
your variable?

34. What built-in
data type is used{"apple", "banana", "cherry"}
when you assignset(("apple", "banana", "cherry"))
a set to your
vari-able? frozenset
frozenset({"apple", "banana", "cherry"}) x =
frozenset(("apple", "banana", "cherry"))

35. What built-in bool
data type is usedTrue
when you assignbool(5)

Información del documento

Subido en
9 de noviembre de 2026
Número de páginas
33
Escrito en
2026/2027
Tipo
Otro
Personaje
Desconocido
$15.49

¿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.
Academia199
3.9
(53)
Vendido
391
Seguidores
209
Artículos
20382
Última venta
5 días 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