

Python tutorial – how to use sets!
This entire series in a playlist:
Also, find me on Instagram:
And Twitter:
And Facebook:
source
Python tutorial – how to use sets!
This entire series in a playlist:
Also, find me on Instagram:
And Twitter:
And Facebook:
source
def sum(x):
y=0
x=x.split()
x=set(x)
for i in x:
y=int(i)+y
print(y)
n=input("enter some number with space: ")
sum(n)
Fantastic teacher. I have struggled with coding for 4 years, and you've really helped a lot. Such a legend, thank you so much.
given_list = [1, 3, 4, 1, 3]
new_set = set()
new_list = list ()
total = 0
for x in given_list:
new_set.add(x)
for x in new_set:
new_list.append(x)
total += x
print(new_list)
print(total)
Hi ive been watching your python series and I really learned a lot in your tutorial videos. Your explanation makes it easy to understand. I wonder if you have a series for Python NLTK.
#hi this is my solution regards from bolivia and thank you
g=set()
sum=0
counter=0
z=[1,3,4,1,3]
print(z)
for y in z:
g.add(y)
print(g)
for y in g:
sum=sum+y
counter+=1
print(sum)
print(counter)
Lets see if it works …ย
and it does! ๐ย
– Cheers for the good work mate!
I used a for loop for this question:
new_set2 = set()
for x in given_list3:
new_set2.add(x)
total = 0
for x in new_set2:
total = total + x
print(total)
5:30 [ in Jupyter notebook 5.7.7 the set makes the right order in which you add things now]
release this as a jn plz
please continue the series from this beginner level to advanced level and make projects tutorial.ur vids are awesome.u talk so well
Why apple and banana though lol
#list = [1,3,4,1,3]
#find unique numbers in "list" to sum up
list = [1,3,4,1,3]
b = set()
for x in list:
b.add(x)
k = sum(b)
print(k)
Thank you so much sir๐
Hi… First of all, many thanks for teachin us to help learn a new lang. Am from India (Tamil_Nadu) Please dont stop ๐.. Pls continue wit ur python tutorial. I am a non programmer and I am learning python by watchin ur tutorials. I dint find any of the other online tutorials appealing. Humble request…please Cont wit ur tutorial๐ ๐ ๐
Sir, we can simply put this code also :
J = set(g)
sum(j)
So why you always do this for adding something in a set ( just highlighting j = set(g) ) :
set_1 = set()
for x in g:
set_1.add(x)
print(set_1)
is the series over?
awesome
FYI you can just cast a set into a list now, no more for-loop needed: new_list = list(new_set)
For the second part of the video:
given_list2=[1,3,4,1,3]
print(sum(set(given_list2)))
Again, no for-loop needed.
I did:
list = [1,3,4,1,3]
strip = set(list)
total = 0
for x in strip:
temp = x
total = total + temp
print(total)
Will there be more episodes? Learning from this channel is great
I think you could have talked about type casting aswell as it would be much faster.
A = [1,2,3,2,3,2,1] # set
B=set(A) # type casts list A into set
A=list(B) # type casts set B into list"
it would be better if you gave the solution in the next video
I have question that ,do you finish the full course of python or not…..
If not please continue the series….
And i,am big fan of your videos that, i have started learning python from your videos…!!