This content originally appeared on DEV Community and was authored by Cristian Fernando
Explica este código Python
Dificultad: Fácil
x = {"a", "b", "c"}
print("c" in x)
-
A.
True
-
B.
False
-
C.
NameError
-
D.
SyntaxError
Respuesta:
👉 A. True
Podemos usar el operador in
para verificar si un valor pertenece o no a un conjunto.
En nuestro ejemplo c
si esta en el conjunto x
, entonces regresamos True
.
This content originally appeared on DEV Community and was authored by Cristian Fernando
Cristian Fernando | Sciencx (2024-07-02T11:00:00+00:00) Ibuprofeno.py💊| #130: Explica este código Python. Retrieved from https://www.scien.cx/2024/07/02/ibuprofeno-py%f0%9f%92%8a-130-explica-este-codigo-python/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.