Da się to jakoś ładniej napisac?
result = {}
for x in lista:
result[x.name] = x.value
return result result = {}
for x in lista:
result[x.name] = x.value
return result
źródło: comment_M9AdNSubvFrzUBeJTXV4LbSHNaGtBIvp.jpg
Pobierzwith open('milion.txt', 'w') as file_obj:
file_obj.write(value for value in range(1, 1000001))
źródło: comment_Ag9n1q8cQIV3EXeZETWQ7PlZ26eZT0mI.jpg
PobierzRocznica
od 14.09.2025
Gadżeciarz
od 17.09.2015
Mikroblogger
od 31.01.2016
Regulamin
Reklama
Kontakt
O nas
FAQ
Osiągnięcia
Ranking
mam 2 listy,
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
chce w jednej linijce utworzyć listę c będącą częścią wspólną tych list(bez powtórzeń)
c = [element for element in a if element not in c and element in b]