Dictionary Problem | Part - 23 | DSA in python in telugu | Engineering Animuthyam
HTML-код
- Опубликовано: 29 сен 2024
- Free python dsa course in Telugu | Part - q | Engineering Animuthyam
Free python dsa course in Telugu
Website link:
vigneshreddyjulakanti.in/python
Insta:
Engineering Animuthyam
python dsa
dsa python
python in telugu
telugu python
Dsa in telugu
from scratch
easy
hd
simple
telugu engineering
dsa
coding
programming
engineering
engineering animuthyam.
jobs
high paying jobs
road maps
Dsa in telugu
Mern stack
Python
Java
M1
Daa
Placements
Btech
IIt
Nit
Eamcet
#coding #telugu #job #python #telugumemes #trendingreels #btech #college #java #javacoding #iit #pythontutorialtelugu
#nit #jee #eamcet #dsa
Macha ma kosam late nights work chesthunnavaaa
Anyways take care of your health also ❤
bro videos daily 2 petu bro plese and bayata book untey chepu chaduvukuntam dsa python ki related i want to learn quick
bro inbuilt fuctions vadacha
Nuvvu top macha
nums = [3,2,3]
d ={}
for i in nums:
if i not in d :
d[i] = 1
else:
d[i] +=1
for i in d:
if d[i] > len(nums) /2:
print(i)
output:
3
what if equal value of most frequent element. like arr= [1,2,2,2,3,3,3] ? by using sort() as you said then what output will come? and why?
# l=[3,2,3]
# dict={}
# temp=0
# v=[]
# k=[]
# for i in l:
# if i not in dict:
# dict[i]=1
# else:
# dict[i]+=1
#
# for key,values in dict.items():
# k.append(key)
# v.append(values)
# print(k[v.index(max(v))])
#approach-2
l=[1,2,2,2,1,1,2]
l.sort()
temp=len(l)//2
print(l[temp])
Bro from collections import counter ane built in function use cheyocha
list1 = list(input().split())
dici = {}
for i in range(len(list1)):
if list1[i] not in dici:
dici[list1[i]] = 1
else:
dici[list1[i]] = dici[list1[i]] + 1
print(dici)
Hi macha