Тёмный
No video :(

for loop in python part-2 | Lec-11 

MANISH KUMAR
Подписаться 21 тыс.
Просмотров 1,9 тыс.
50% 1

In this video, I have talked about the fundamentals of programming and Python. If you complete this, you will be well-versed in using list for different use case.
paragraph = """ Ralph Kimball founded the Kimball Group. Since the mid-1980s, he has been the
data warehouse and business intelligence industry’s thought leader on the dimen
sional approach. He has educated tens of thousands of IT professionals. The Toolkit
books written by Ralph and his colleagues have been the industry’s best sellers
since 1996. Prior to working at Metaphor and founding Red Brick Systems, Ralph
coinvented the Star workstation, the fi rst commercial product with windows, icons,
and a mouse, at Xerox’s Palo Alto Research Center (PARC). Ralph has a PhD in
electrical engineering from Stanford University """
Directly connect with me at:- topmate.io/man...
Discord channel:- / discord
For more queries reach out to me on my below social media handle.
Follow me on LinkedIn:- / manish-kumar-373b86176
Follow Me On Instagram:- / competitive_gyan1
Follow me on Facebook:- / manish12340
My Second Channel -- / @competitivegyan1
Interview series Playlist:- • Interview Questions an...
My Gear:-
Rode Mic:-- amzn.to/3RekC7a
Boya M1 Mic-- amzn.to/3uW0nnn
Wireless Mic:-- amzn.to/3TqLRhE
Tripod1 -- amzn.to/4avjyF4
Tripod2:-- amzn.to/46Y3QPu
camera1:-- amzn.to/3GIQlsE
camera2:-- amzn.to/46X190P
Pentab (Medium size):-- amzn.to/3RgMszQ (Recommended)
Pentab (Small size):-- amzn.to/3RpmIS0
Mobile:-- amzn.to/47Y8oa4 ( Aapko ye bilkul nahi lena hai)
Laptop -- amzn.to/3Ns5Okj
Mouse+keyboard combo -- amzn.to/3Ro6GYl
21-inch Monitor-- amzn.to/3TvCE7E
27-inch Monitor-- amzn.to/47QzXlA
iPad Pencil:-- amzn.to/4aiJxiG
iPad 9th Generation:-- amzn.to/470I11X
Boom Arm/Swing Arm:-- amzn.to/48eH2we
My PC Components:-
intel i7 Processor:-- amzn.to/47Svdfe
G.Skill RAM:-- amzn.to/47VFffI
Samsung SSD:-- amzn.to/3uVSE8W
WD Blue HDD:-- amzn.to/47Y91QY
RTX 3060Ti Graphic card:- amzn.to/3tdLDjn
Gigabyte Motherboard:-- amzn.to/3RFUTGl
O11 Dynamic Cabinet:-- amzn.to/4avkgSK
Liquid cooler:-- amzn.to/472S8mS
Antec Prizm FAN:-- amzn.to/48ey4Pj

Опубликовано:

 

29 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 19   
@AbhinavShukla-ki5jd
@AbhinavShukla-ki5jd Месяц назад
A bettery way? lst=[5,18,77,108,930] number=9 print(lst) for i in range(len(lst)): if number
@amazhobner
@amazhobner 6 месяцев назад
lst = [202, 165, 89, 76, 12] number_to_insert = 10 for i, num in enumerate(lst): if num
@pharas_tech
@pharas_tech 18 дней назад
lst = [202,165,89,76,12] number_to_insert = 15 index = 0 for number in lst: if number < number_to_insert: index = index break else: index +=1 lst.append(None) for i in range(len(lst)-1,4,-1): lst[i]= lst[i-1] lst[index] = number_to_insert print(lst)
@VivekKhare-z1m
@VivekKhare-z1m Месяц назад
Assignment: lst = [202,165,89,76,12] number_to_insert = 15 index = 0 for number in lst: if number < number_to_insert: index = index break else: index = index + 1 lst.append(None) for insert_value in range(len(lst)-1,index,-1): lst[insert_value] = lst[insert_value - 1] lst[index] = number_to_insert
@yashiyengar7366
@yashiyengar7366 3 месяца назад
lst = [202,165,89,76,12] num_insert = 120 index = len(lst)-1 for i in range(len(lst)-1,-1,-1): if lst[i] > num_insert: index = index break else: index -=1 lst.append(None) index +=1 for j in range(len(lst)-1,index,-1): lst[j] = lst[j-1] lst[index] = num_insert print(lst)
@sarveshkumar-tq4fn
@sarveshkumar-tq4fn 4 месяца назад
# Inserting Element in List lst = [18,86,77,102,730] inserted_number = 100 index = 0 for num in lst: if(num>inserted_number): index = index break else: index = index + 1 lst.append(None) for i in range(len(lst)-1,index,-1): lst[i] = lst [i-1] lst[index] = inserted_number logging.info(lst)
@user-pb7nb2lc7f
@user-pb7nb2lc7f 6 месяцев назад
#Assignment: Insert number in such a way that list is sorted in Descending order lst = [202,165,89,76,12] number_to_insert = 15 index = 0 for num in lst: if num < number_to_insert: index = index else: index += 1 lst.append('None') for i in range(len(lst)-1,index,-1): lst[i] = lst[i-1] lst[index] = number_to_insert print(lst) Hi @Manish, Is there any optimized way to traverse , lets say if i've a list of 10k element, then here traversing will take more time.
@raajnghani
@raajnghani 6 месяцев назад
index = 0 number_to_insert = 15 lst = [202,165,89,76,12] for number in lst: if number
@divyaborse5866
@divyaborse5866 3 месяца назад
list1 =[202,165,89,76,12] target =15 pos=0 if len(list1)==0: list1.append(target) elif len(list1) == 1 and list1[0] < target: list1.append(list1[0]) list1[0] =target elif len(list1) == 1 and (list1[len(list1)-1] > target or list1[0] > target): list1.append(target) else: for i in range(len(list1)): if list1[i] < target: pos= i break print(pos) list1.append(None) print(len(list1)) for i in range(len(list1)-1,pos-1,-1): list1[i] =list1[i-1] list1[pos]= target print(list1)
@AnuragRaut-ry2oq
@AnuragRaut-ry2oq 2 месяца назад
# Assignment lst = [202, 165, 89, 76, 12] index = 0 number_to_insert = 15 for number in lst: if number < number_to_insert: index = index else: index +=1 print(index) lst.append(None) for i in range(len(lst)-1,index,-1): lst[i] = lst[i-1] lst[index] = number_to_insert logger.info(f"new list {lst}")
@nabyenduKuiti
@nabyenduKuiti 2 месяца назад
How to practice loop ?
@manish_kumar_1
@manish_kumar_1 2 месяца назад
Geeks for geeks website
@satyamkumarjha4185
@satyamkumarjha4185 Месяц назад
8
@anubhavsharma9449
@anubhavsharma9449 6 месяцев назад
why you deleted pyspark playlist?
@ShubhamRai06
@ShubhamRai06 5 месяцев назад
Hai to bhai, kaha delete ki ,
@vinu11sharma
@vinu11sharma 4 месяца назад
# 1st Way lst = [12, 76,89,165,202] lst.append(15) lst.sort() print(lst) #2nd Way lst_1 = [12, 76,89,165,202] index=0 logger.info(f" index value is {index} List Value is {lst_1}") for i in range(len(lst_1)-1): if lst_1[i]>120: index=index logger.info(f"if loop value i is {i} and index value is {index}") else: index=index+1 logger.info(f"Else loop value i is {i} and index value is {index}") lst_1= lst_1 + [None] print(lst_1) for j in range(len(lst_1)-1,index,-1): print(f"J value is: {j}") print(f"list value is: {lst_1[j]}") lst_1[j]=lst_1[j-1] print(lst_1) lst_1[index]=120 print(lst_1)
@abhinavsingh2894
@abhinavsingh2894 3 месяца назад
# Assignment Problem lst = [202,165,89,76,12] number_to_insert = 15 # Insert the number 15 in such a way that list is sorted in desending order. index = 0 # finding the index of the place where number needs to be added for number in lst : if number < number_to_insert: index = index break else: index = index +1 logger.info(index) lst.append(None) logger.info(lst) # [202, 165, 89, 76, 12, None] # traversing the list for i in range(len(lst)-1,index,-1): # (5,4,-1) lst[i] = lst[i-1] lst[index] = number_to_insert logger.info(lst)
@anmolgupta1348
@anmolgupta1348 4 месяца назад
from loguru import logger list=[202,165,89,76,12] index=0 num_insert=15 list_asc=list[::-1] for i in list_asc: if i>num_insert: index=index break else: index=index+1 list_asc.append(None) logger.info(list_asc) for j in range (len(list_asc)-1,index,-1): list_asc[j]=list_asc[j-1] list_asc[index]=num_insert list_asc1=list_asc[::-1] logger.info(list_asc1)
@vishnu000001
@vishnu000001 5 месяцев назад
lst = [202,165,89,76,12] number_to_insert = 15 index = 0 for i in lst: if i > number_to_insert: index = index +1 else: break print(index) lst.append("None") print(lst) for j in range(len(lst)-1,index,-1): lst[j] = lst[j-1] lst[index] = number_to_insert print(lst)