Coding Interview Questions and Answers | Python Interview Questions and Answers

preview_player
Показать описание
Coding Interview Questions and Answers | Python Interview Questions and Answers
This video is part of Coding Interview Questions and Answers series .In this video,i have explained one more Coding Question with proper explanation. This question includes control sequences concepts.
Follow exception handling tutorial using below link..

1) Infosys Coding Question
2) Logical Questions in Python
3) Interview Questions and Answers

source code :-

About Python Tutorial:- python for beginners-Go from Zero to Hero in python.This tutorial includes python programming videos from basics to advanced

More tutorials:-

About codeyug :-
Codeyug provides tutorials for building your programming skills.Here,you will learn various programming languages,computer science,web development with free of cost.

SHARE | SUBSCRIBE | LIKE
-- - - - - - - - - - - - - - - - - -Thanks for watching this video - - - - - - - - - - - - - - - - - -- -
Our social links:-
creator:-
$ -shantanu kejkar -$

#python #python3 #programming #codeyug #tutorial #beginners #coding
Рекомендации по теме
Комментарии
Автор

test = 'aaaabbbccddddr'
output = ''
for i in range(len(test)):
if(test[i] not in output):
output = output + str(test.count(test[i])) + test[i]
print(output)

techtricks.tech_
Автор

6:23 In anaconda line no 12 is giving error " TypeError: 'str' object is not callable" .While doing the same in VS code it is not returning the last letter and last letter count ie for aaaabbbccdd its returning 4a3b2c. Its skipping d and d - count .

sandeepdash
Автор

str1 = input("Enter your input in the format of AAABBCCC: ")
s = set(str1)
l = []
for x in s:
l.append(x + str(str1.count(x)))
str2 = ''.join(sorted(l))
print(str2)

simplyVeer
Автор

n="aaabbcdd"
#3a2b1c2d
fin=""
for i in n:

co=n.count(i)
if str(co)+i in fin:
pass
else:
fin=fin+(str(co) +i)
print(fin)

unkownknown
Автор

Sir please make a video on this question

removing outermost parentheses from each primitive substring.

Input: S = “(()())(())()”
Output: ()()()

Input: S = “((()())(())(()(())))”
Output: (()())(())(()(()))

nikitavhatkar
Автор

a= 'aaaabbbccd'
out=''
for i in a:
count=0
for j in a:
if i ==j:
count+=1
if i not in out:
out+=str(count)+i
print(out)

suchandankhan
Автор

word = 'aaaabbbccd'

unique = sorted(list(set(word)))
print(unique)

lista = []
for i in unique:
lista.append(word.count(i))
print(lista)

output = []
for i in range(len(lista)):

print(''.join(output))

tpadma
Автор

Bhai ap mast samjate ho please or video dalo na program ka

AbhishekKumar-ppth
Автор

input="aaaabbcccn"
c=''
for i in input:
if i not in c:
c+=i
for i in c:
v=input.count(i)
print("".join((f'{v}', i)), end="")

RoyalSuperCell
Автор

in Python.
a=True, True, True
print(a)
output - (True, True, True)
a == True, True, True
output - False, True, True
why given False ?

NiteshSingh-vwin
Автор

for i in s:
if i not in d:
d=d+str(s.count(i))+i

print(d)

gourikalahal
Автор

sir agar str1="aaabbbazccz" isko kese solve karenge.

PushpendraLowanshi
Автор

inputs="aaaabbbccd"
output = "4a3b2c1d"

# using list
newdata=[]
outputfirst=""
for i in inputs:
if i not in newdata:
newdata.append(i)
for j in newdata:
count=0
for k in inputs:
if j==k:
count+=1

outputfirst+="{0}{1}".format(count, j)
print(outputfirst)



#using

outputseconds=""
dicts={}
for i in inputs:
dicts.setdefault(i, []).append(i)

for j, k in dicts.items():
outputseconds+="{0}{1}".format(len(k), j)
print(outputseconds)

dhananjaysingh
Автор

Sir ager questions aaaabbbaaccadd aa jaye to kya karna chahiye

ganeshpal
Автор

# input :"aaaabbbccd",
# output :"4a3b2c1d"
Another way

new_dct={}
str1="aaaabbbccd" # p =
for s in str1:
#print(s)
if s in new_dct:
cnt=new_dct[s]
new_dct[s]=cnt+1
#print(cnt)
else:
new_dct[s]=1
print("new_dct", new_dct)
final_str =""
for k, v in new_dct.items():
final_str= final_str+str(v)+k

print(final_str)

anusreekp
Автор

a="aaaabbcccaj"
b=""
c=""
count=0
for j in a:
if j not in b:
b=b+j
for i in range (len(a)):
if j==a[i]:
count+=1
c=c+str(count)
count=0
print(b)
print(c)
d=""
for i in range(len(b)):
d=d+c[i]+b[i]
print(d)
First time I code something 😅


p=dict()
d=""
count=0
for i in a:
if i not in d:
count=1
d=d+i
else:
count=count+1
p[i]=count
print(p)
str1=''

for h in p:
str1+=str(p[h])
str1+=h
print(str1)

nishantraj-essl
Автор

s='aaabbbazccz'

result = '4a3b2z2c'


s1 = lambda b:str(string.count(b))+b, string))
print(''.join(s1(s)))

Viveksoftdev
Автор

Bro how to connect with you
Your insta id and other platforms where I can connect with you

er.saurabbhkumar
Автор

s="aaabbbcccdddz"
newstr={}
for i in s:
if i in newstr:
newstr[i]=newstr[i]+1

else:
newstr[i]=1
ls=[]
for k, v in newstr.items():
d=str(v)+k
ls.append(d)
print(''.join(ls))

hfkdnqh