How to take user input for List and Nested List using For Loop and List Comprehension in Python

preview_player
Показать описание
#python #PythonProgramming #programming #tutorials #beginners #computerscience #list #nestedlist #forloop #listcomprehension
#ProgrammingLanguage #Interview #InterviewQuestions #coding #pythoncoding

About Video : How to take user input for List and Nested List using For Loop and List Comprehension in Python

Course python for Patterns, Example Problems, Data Structures and Algorithms crash course (3 in 1 course)

Connect with Me On :=
Instagram : hi_vinzy

If you find this video helpful please Like,Share and Subscribe
and I'll see ya in the next one!!!

python tutorial,python tutorial for beginners,python,python tutorial in hindi,lists in python,python programming,nested list in python,list in python,python lists,python list comprehension tutorial,nested lists in python,python nested list comprehension,python list comprehension,python lists tutorial,python list comprehension multiple for loops,list comprehension python,python list tutorial,list comprehension,list comprehension in python
Рекомендации по теме
Комментарии
Автор

Course python for Patterns, Example Problems, Data Structures and Algorithms crash course (3 in 1 course)

TycomacCodes
Автор

Nicely explained. I was having difficulty understanding the concept but now i understood. Subscribed. Thanks

anilpillai
Автор

Appreciate you sir that you read viewers comments and make a video over body as made over this concept

akeshagarwal
Автор

Source code:

lst1 = []

no_of_items = int(input("enter the no. of items"))

for i in range(no_of_items):
num = eval(input("enter the value:"))
lst1.append(num)

print(lst1)

no_of_items = int(input("enter the no. of items"))

lst2 = [ eval(input("enter the val")) for i in range(no_of_items)]
print(lst2)



lst3 = []

no_of_items = int(input("enter the no. of items"))

for i in range(no_of_items):
lst4 = []
size = int(input("enter the size of sub_list"))
for j in range(size):
value = int(input("enter the value:"))
lst4.append(value)
lst3.append(lst4)

print(lst3)


no_of_items = int(input("enter the no. of items"))
size = int(input("enter the size of sub_list"))
lst5 = [ [int(input("enter the val")) for j in range(size) ] for i in range(no_of_items)]
print(lst5)


no_of_items = int(input("enter the no. of items"))
lst6 = []

for j in range(no_of_items):
size = int(input("enter the size of sub_list"))
lst7 = [int(input("enter the value")) for i in range(size)]
lst6.append(lst7)

print(lst6)

TycomacCodes
Автор

Sir great video I appreciate 🙏 🙌 👍 ❤ 👏

purshottamkumar