Alguien podría ayudarme | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 3

Alguien podría ayudarme

necesito crear un codigo que me diga si el subconjunto ola entra en el conjunto hola y que imprima si pertenece o no pertenece

14th Feb 2017, 2:37 AM
Fany Ruiz
Fany Ruiz - avatar
1 Answer
+ 3
Q: How to check if a set is a subset of another set? A: Consider building a set from a list, then converting it with set(). Finally, check whether is a subset with issubset(): hola=set(['h','o','l','a']) #build a set ola=set(['o','l','a']) #ditto print(ola.issubset(hola)) #True
14th Feb 2017, 6:28 AM
Álvaro