Seturi
š£š£š£ (set of sushi)
ScrieČi un program pentru a afiČa numÄrul de vocale in
stringutilizĆ¢nd seturiScriČi un program care va converta set in disČionar.
AflaČi dacÄ un Čir are caractere unice, dacÄ conČine duplicate returneazÄ False
ScrieČi un program Python pentru a gÄsi valoarea maximÄ Či cea minimÄ Ć®ntr-un set.
#1
def vowel_count(str):
count = 0
vowel = set("aeiouAEIOU")
for alphabet in str:
if alphabet in vowel:
count = count + 1
print("No. of vowels :", count)
str = "GirlsGOIT"
vowel_count(str)
#2
set1 = {1, 2, 3, 4, 5}
print ("initial string", set1 )
print (type(set1 ))
res = dict.fromkeys(set1 , 0)
print ("final list", res)
print (type(res))Last updated