Python program to shift elements | Q 34 CBSE Sampler | Computer Science Class 12 Python

preview_player
Показать описание
Python program to shift elements | Computer Science Class 12 Python

Join this channel to get access to perks:

YT 1k Sub.
Channel Trailer video

random module

Mathematical and String Functions

Using Python Libraries:

Data Structures: Stack and Queue

File Handling:

Recursion

Idea of Algorithmic Efficiency

Interface Python with MYSQL:

MYSQL
Computer Networks:

Programming Corner:
Output Based Questions:

Boolean Algebra

Basics of Python

Flow of Control

String Manipulation

List Manipulation

Dictionaries

Sorting
Рекомендации по теме
Комментарии
Автор

Easy way to do this ques:-

def lshift(arr, n):
l=len(arr)
k=list(arr)
for i in range(n):
a=k.pop(0)
k.append(a)
print('New Arr=', k)

arr=[10, 20, 30, 40, 12, 11]
n=2
lshift(arr, n)

mastermind
Автор

watching for the first time and what an experience, explanation was too good

arindamn
Автор

Mere to scl wale madam apne class ke time pe aapki hi video chala deti h 😂😂😂

alokrodiya
Автор

def lshift(arr, n):
For i in range(len(arr)):
arr[i]=arr[i-n]
print(arr)

poojaKumari-ojeg
Автор

Thanks Tusi great ho....
One of the best explanation.. 🙏🙏🙏🙏🙏

AyushYadav-jcmg
Автор

Mam explanation tomorrow is my cs pre board xam

lokeshkumarb
Автор

Nice videoes here for class 12th students 💕😊😍

santoshmaravi
Автор

Mam please make a video on how to start preparation for class 12 computer scienece

sunilrajoria
Автор

Mam please help
Agar hum 2 for loop use kare ek
.1) for j in range(0, n):
And
.2 ) for i in range (n, len(arr)+1):

Kare aur phir dono results ko i.e. arr[j], arr[i] ko combined kar de toh ????

mishra
Автор

Thank you mam❤️
Mam jitna bhi thanks bolu kam hi lagta h😊

aishanasim
Автор

Friends try this code for this question
def lshift (Arr, n)
B= Arr[2:] + Arr[0:2]
Print(B)
Arr=[10, 20, 30, 40, 50]
n=2
lshift(Arr, n)

amirop
Автор

def LShift(Arr, n):
x=[]
y=Arr
for I in range(n) :
x. append(Arr[I])
for I in range (n) :
Arr. pop(0)
Arr+=x
print ("Old list:", y)
print ("New list:", Arr)
Arr=[10, 20, 30, 40, 12, 11]
n=2
LShift(Arr, n)

Mam is this suitable?

preetammandal
Автор

Ma'am isse related aur que ka video banadije

AnushkaSingh-uxow
Автор

def LShift(Arr, n):
for i in range(n):
Arr.append(Arr[0])
Arr.pop(0)
print (Arr)
Arr=eval(input("Enter list:-"))
n=int(input("Enter number:-"))
LShift(Arr, n)

argon
Автор

Thankyou mam 🙏 mam par last question bhi

himanshuchauhanfitness
Автор

Mam I have a doubt mam jab aapne n ki value 2 di thi to wo ek kam tak chalta hai matlab 1 baar chalega lekin mam usne do elements shift kiye ye kaise mam

mohdwaqarahemed
Автор

In eval(input()) , "eval" means

kancharlajyothi
Автор

Ma'am please make a similar one fir Rshift tooo like shifting the elements to the right.

dushyantbatra
Автор

Mam iss type ka or video uploade kariye na

hindumuslim
Автор

Wow...such a coincidence...mam actually m also solving the same sample ppr and this qs is 34th qs...this qs ppr is provided by our school teacher...may be tomorrow she gave qs from this....
Mam do u solve all the qs of this sample ppr...if yes plzz reply mam ...plZz🙏🙏🙏🙏🙏🙏

lokeshkumarb