Python Programming Questions for Interview | Python Interview Questions and Answers For Frehsers

preview_player
Показать описание
Python Programming Questions for Interview | Python Interview Questions and Answers For Frehsers
This video is part of Python Interview Questions and Answers. In this video, I have explained 3 important logical coding questions in python. Let's understand...

1) Python Interview Questions and Answers
2) Logical Questions in Python

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
Рекомендации по теме
Комментарии
Автор

***Another method to solve 3rd Problem (without creating another list)***
str1='a, b, b, c, c, c, d, d, e, a'
visited=[ ]
for char in str1:
if char not in visited and char!=", ":
print(f"{char}:{str1.count(char)}", end=", ")
visited.append(char)

Output: a:2, b:2, c:3, d:2, e:1,

Thankyou so much dude, Loved your teaching style man :)

anmolyadav
Автор

Reversed list of string with different method

1) using inbuilt reversed function.

Str1 =[ "sky is blue"]
S2 =" ".join( reversed(Str1))
Print(S2)

2) using slicing method .
Str1 =[ "sky is blue"]
Print(Str1[::-1].split())

3) using while loops

Str1 =[ " sky is blue"]
S2 = Str1.split()
I=0
S3=" "
While i >0:
S3+=S2[i]
i-=1
Print(S3)

4)

Str1 =[ "sky is blue"]
S2 = Str1.split()
Print(S2[::-1])


5) using for loops

Str1 =[ "sky is blue"]

S2=" "
For i in Str1[::-1].split():
S2+=I
Print(S2)

IQ_reviews
Автор

Bhaiya I am your biggest fan Love from jharkhand dhanbad ❤️

Rising_night_
Автор

Wow
Nice explanation very helpful video✨thanks🙂

cchandrikareddy
Автор

mystr="a, a, a, b, b, c, c, c"
b=""
e={}
a=mystr.split(', ')
for i in a:
if(i.isalpha()):
if(i not in b):
b=b+i#'a'+''='a'
d=a.count(i)
e.setdefault(b, d)
b=''
print(e)

tyagishiva
Автор

for reversing just simply we can do it in one line -
print(' '.join(str1.split(' ')[::-1]))

bidhanry
Автор

Sir itna achha content ❤️ Dil khus ho gaya

khetrabasitechvideo
Автор

Sir u deserve more subscriber... YouTube Mee dhund loo itna achha he koi v python ko samajhaya nahi

khetrabasitechvideo
Автор

L=[a, a, a, b, b, c, c, c]
D=dict()
For i in L:
If I not in D:
D[I]=1
Else:
D[I]+=1
Print(D)

IQ_reviews
Автор

Very well explained, it was really helpful. Expecting many more videos from u related to python interview questions

vijendrachauhan
Автор

SoltoQ2:
input = [1, 2, 2, 3, 3, 4, 5, 5, 5, 6, 6]
store = {}
for obj in input:
if obj in store.keys():
store[obj] += 1
else:
store[obj] = 1

returnable = []
for key in store.keys():
if store[key] == 1:
returnable.append(key)

print(returnable)

meikamandoliini
Автор

Another way to do the 3rd problem is by importing Counter from collections module. the output will appear in a set
from collections import Counter
mystr = "a, a, a, b, c, b, b, c, c, c"
mylist= mystr.split(', ')
print(Counter(mylist))

output: Counter({'c': 4, 'a': 3, 'b': 3})

naguk
Автор

“Sir, this playlist containing 352 videos combines multiple playlists. Should I watch this playlist or follow each playlist separately?”

RahulVerma-mqpr
Автор

SoltoQ3:
input = "a, a, a, b, b, c, c, c"
input = input.split(", ")
store = {}
for obj in input:
if obj in store.keys():
store[obj] += 1
else:
store[obj] = 1

returnable = []
for key in store.keys():


print(", ".join(returnable))

meikamandoliini
Автор

list = [1, 2, 2, 3, 3, 4, 5, 5, 6, 6]

l = []
for li in list:
if list.count(li) == 1:
l.append(li)
print(l)

vaibhavverma
Автор

SoltoQ1:
input = "Sky is blue"
if input[-1] == ".":
input = input[0:-1]

l = input[0]
input = input.replace(l, l.lower())
input = input.split(" ")
input.reverse()
print(" ".join(input))

meikamandoliini
Автор

good explanation, if possible make more videos like this.

arindampadhy
Автор

To solve 3rd problem in one line using dict comprehension.
my_str = "a, a, a, b, b, c, c, c"
d= {i:my_str.count(i) for i in my_str if i != ', '}

arun
Автор

print(f"\"{str2}\" ")

Output: "blue is sky"

systemsinfo
Автор

Ek number bhai mst video tha biginer ke liye

priyanshugupta