Python Interview Questions and Answers | Logical Questions in Python | Printing Duplicates in List

Python Interview Questions and Answers | Logical Questions in Python | Printing Duplicates in List

Code-yug

2 года назад

67,341 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@nasibpatel6740
@nasibpatel6740 - 08.11.2023 11:57

Can also possible using dict

Ответить
@sourabhmori8129
@sourabhmori8129 - 24.10.2023 08:45

Bhai logic Building par ek video banao please that how to built a logic please please please bohot zarourat he mujhe please 😥😭🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏

Ответить
@prathamhans920
@prathamhans920 - 27.09.2023 14:07

bai bhot acha samjhate hooo

Ответить
@roshan_off1955
@roshan_off1955 - 20.07.2023 18:58

Nhi aya smjh

Ответить
@Lividbuffalo
@Lividbuffalo - 11.07.2023 15:46

What is “atoms”?

Ответить
@dwaipayansaha4443
@dwaipayansaha4443 - 29.03.2023 18:18

My solution:
x=['hello',10,20,40,20,60,40,50,20]
y=[]
for i in x:
if x.count(i)>1:
y.append(i)
print(list(set(y)))

Ответить
@bazzelrahman5879
@bazzelrahman5879 - 12.03.2023 14:01

Sir aur questions ki video banao isi se related. Isme thoda confusion hai

Ответить
@johnsnow007
@johnsnow007 - 28.01.2023 20:08

Excellent bro 🙂

Ответить
@kratikamishra5464
@kratikamishra5464 - 15.01.2023 18:56

Bhai aapne coding kaise sikhi

Ответить
@manofsteel6173
@manofsteel6173 - 06.01.2023 10:21

Keep making videos like these...I'm know c and python basics but don't know how to implement that ..I mean idk how to find out logics of any questions..😢..plz give me a suggestion sirr.

Ответить
@Nuraini-zn8kr
@Nuraini-zn8kr - 09.12.2022 11:38

excuse me, sir, how about not duplicating? this video only shows if there are duplicates in the list, what if the list doesn't have duplicate elements?

Ответить
@badrenanna3961
@badrenanna3961 - 05.12.2022 01:29

Other possible solution :
Li = [33,44,33,66,77,88,99,33]
Du = {Li[i]:i for i in range(len(Li)) if Li[i] in (Li[0:i-1]+Li[i+1:-1])}
print(Du.keys())

Ответить
@beniciocardoso9179
@beniciocardoso9179 - 26.11.2022 04:03

Thanks for your explanation. Following one more possible solution.

l=["hello",10,20,10,"hello",10,20,30,40,10,20]

uniq_elements=[]
duplicate_elements=[]

for item in l:
if item not in uniq_elements:
uniq_elements.append(item)
else:
duplicate_elements.append(item)

print(duplicate_elements)

Ответить
@ar7520
@ar7520 - 31.10.2022 08:06

This code not working properly

Ответить
@Jaymahakal-ki7bj
@Jaymahakal-ki7bj - 27.10.2022 16:57

Life me pehli bar esa kuch dekha mene

Ответить
@akashgupta3322
@akashgupta3322 - 20.10.2022 20:15

Mujhe samjh nahi aya kis tarikese condition lagaya gaya he

Ответить
@abhishekpandey3070
@abhishekpandey3070 - 17.10.2022 19:37

we can make dict also

Ответить
@hamzaghannem7098
@hamzaghannem7098 - 02.10.2022 00:39

list(set([el for el in l if l.count(el)>1]))

Ответить
@kashishlohiya6170
@kashishlohiya6170 - 27.08.2022 15:57

Can be done using dictionary as well

Ответить
@sktalkiessj
@sktalkiessj - 05.08.2022 12:08

Samjh me nhi aa rha h sir clear 😔

Ответить
@rajm5349
@rajm5349 - 12.07.2022 14:28

Can u explain anything bnkng projects or fraud detection or loan projects or retail projects kindly explain

Ответить
@_SanchitaPatil
@_SanchitaPatil - 11.07.2022 21:02

how l[i] is hello?

Ответить
@ben10secretoftheomnitrix89
@ben10secretoftheomnitrix89 - 30.06.2022 12:31

what is meaning -> in python like
L1 = [1,2,3,4, ["python","java","c++",(10,20,30)],5,6,7,["apple","banana","orange"]]
Print following
orange->e
what is solution

Ответить
@sushmitasingh7643
@sushmitasingh7643 - 29.06.2022 04:17

Thoda sa samjh aaya hai.. please dubara smjha do.

Ответить
@ritwiksingh4937
@ritwiksingh4937 - 06.06.2022 13:23

pandas.DataFrame(l).drop_duplicates()... this method is acceptable?

Ответить
@krushnakantkalaskar4084
@krushnakantkalaskar4084 - 27.04.2022 19:38

thanks bro instested of list d we set can also be used no repetation

Ответить
@SatyendraSingh-lx7ru
@SatyendraSingh-lx7ru - 02.04.2022 19:37

Thank u for sharing this

Ответить
@sayanchakraborty2194
@sayanchakraborty2194 - 07.11.2021 21:27

little bit problem about second method i and j

Ответить