why u have not used list comphrension method for adding the matrices ? and why r u writing the for loop when u have given the necessary code for matrix1 and 2 in list comphrension method ?
Hey Amulya... I don't understand how the matrix list works (looks like a list comprehension) Can you explain it? If it is a list comprehension, can we get input from inside of the list? Please explain... And your videos are amazing and I love the way you teach
here we are treating nested list as matrix. Yes in the program to enter value to the nested list(matrix) we used list comprehension method. matrix1 = [ [ int(input() for loop for column)] for loop for row ] this is the syntax. :)
Mam I use [[int(input() for i in range(row)]for j in range(col)] It give me same result when I interchanged col and row as u mentioned in this video I tried both its Gove same result
I have a doubt Y we r inputting matrix 1 as for i in range(col) for i in range (row) Y col first and row second And my another doubt is in for loop , for i in range(row) and for j in range (col) y row is first and col is second Y I can't use both as for i in range (row) first and for j in range (col) next Clear my doubt Sisy...
For your first question : If I use [0 for i in range(5)] we will get [0,0,0,0,0] Now we got one row and 5 column and now if we want to print this in 4 rows then we need to take another for loop for that. [[0 for i in range(5)] for j in range(4)] I is column here and j is row. So first take for loop for column then take for loop to print how many row you want 😊 Now for the second question: Here we want to print row0 col0 col1 col 2 col3 col4 After that we need to go to second row (row1) That’s why here outer for loop is for loop for row and inner for loop is for loop for column 😊
Can we write this: matrix1=[ [ int( input( ) ) for i in range(row) ] for j in range(col) ] insteaad of matrix1=[ [ int( input( ) ) for i in range(col) ] for j in range(row) ] If not then what is the reason behind this?
Can anyone help me with 3 line! I am confused of why 'col' is taken first in 'for' loop! 'for' loop works for eg.: # for i in [1,2]: for j in [3,4,5]: print([i][j]) # Output: [[1,3], [1, 4], [1, 5], [2,3]...] _______ If I need to input 2×3 matrix, why can't I put "row" in first "for" loop?
i will explain this with list comprehension. when you take [0 for i in range(5) ] we will get output as [0,0,0,0,0] this is 1×5 array/list here, now if i want 3×5 list then i need to [0 for i in range(5) ]repeat this thrice/we need to loop this thrice. [[0 for i in range(5) ] for j in range(3)].
Madam,please expalin the list comprehension of matrix1 varaible.I seen the previous videos of list comprehension,This kind of example not present in the previous list comprehension video
[[int(input()) for i in range(col)] for j in range(row)] here first [int(input()) for i in range(col)] this will be executed. if i enter col as 4, it will take 4 value for column. { 4 times it will execute int(input()) and we will get 4 integer input } Next, for j in range(row) this for loop will execute. it will run [int(input()) for i in range(col)] this row times {if row is 3 it will run for loop 3 times.}
Hi amulya , can u pls make a video on functions ..u have made basic video ..pls make a video on....how functions can be called inside a function .how var in one functn n accessed with other function in python ...it's a request ,
why do in list comprehension does column for loop comes first and row for loop second while printing its the opposite? also massive respect to you me lady
if you use single list [ 0 for i in range(5)] it will create [0,0,0,0,0] that is the one row right now if i want 4 rows like that i need to write [[0 for i in range(5)] for j in range(4)] :)
@@charu4963 yes it will print one by one Because by default...end 's value is new line.. we need to give space " " so that it's printed in same line. If u have given 2 it would have printed 2 after every number phypythonics.wordpress.com/contents/ You can check out the website
When you use [int(input()) for i in range(col)] it will given you a list with values. for example col=3 if i enter input as 0 then we will get [0,0,0] as output. but here we want nested list for matrix because matrix is 2d so we will use nested list here. [[int(input()) for i in range(col)] for j in range(row)] if row=4 then i will get [0,0,0] 4 times. [[0,0,0],[0,0,0],[0,0,0],[0,0,0]] :)
@@gayathri-8-i6s yes but we can use [[int(input()) for i in range(row)]for j in range(col)] Or we can use [[Int(input()) for i in range(col)]for j in range(row)] We can use both output is same
I made few videos on list comprehension you can watch that :) th-cam.com/video/17gTGqHG5xQ/w-d-xo.html th-cam.com/video/fnJOBQbc7Qg/w-d-xo.html th-cam.com/video/JEapLNRuzVo/w-d-xo.html :)
In the 4 line... i in range col and j in range row.. Ana next line la... i in range row and j in range in col.. Nu iruku.... Athu konjam explain paniringala
end is the parameter in the print(), default value is that is new line. when i write print("hello") it will print message hello and goto the next line {because default value of end = " "} But if we want print stars or number in the same line then we can use end="" :)
best teacher.. knowledge is appreciable and your voice is so melodious too. enjoying learning from here.
Thank you :)
Moat underrated channel for python
Thank you 😊
Thanks a lot u helped me a lot during exams
Thank you for this video.....I was waiting eagerly. I hope you will provide some good questions on matrices.
Thank you very much mam. It helped us a lot for our Group Assignment. Again Thank you so much❤❤❤🥰
very nicely explain thank you best wishes from nepal
I've been trying to get the input from the users ,I watched this and completely understood the concept ,thank you ,I'm so happyyyy
Good teacher, Super mam ,Nice way of teaching,more than thaat Your voice is awesome
Thank you :)
why u have not used list comphrension method for adding the matrices ? and why r u writing the for loop when u have given the necessary code for matrix1 and 2 in list comphrension method ?
can you please explain why u use format function and how to use it
To format the string or number :)
Video link:
th-cam.com/video/L19e53kEciI/w-d-xo.html
wow you really helped me.....thank you
Hey Amulya...
I don't understand how the matrix list works (looks like a list comprehension)
Can you explain it?
If it is a list comprehension, can we get input from inside of the list?
Please explain...
And your videos are amazing and I love the way you teach
here we are treating nested list as matrix.
Yes in the program to enter value to the nested list(matrix) we used list comprehension method.
matrix1 = [ [ int(input() for loop for column)] for loop for row ]
this is the syntax.
:)
@@AmulsAcademy Thanks Amulya...
Mam I use [[int(input() for i in range(row)]for j in range(col)]
It give me same result when I interchanged col and row as u mentioned in this video I tried both its Gove same result
Give me the program 😊
Mam, please make more videos on Python Programming!
Sure 😊
(1:44) 3rows and 2 columns
your teaching method is very nice. But the subtitle is needed
Ok I will remember that :)
for i in range (infinity):
print("YOUR AMAZING MAN LOVE U❤")
I have a doubt
Y we r inputting matrix 1 as for i in range(col) for i in range (row)
Y col first and row second
And my another doubt is
in for loop , for i in range(row) and for j in range (col) y row is first and col is second
Y I can't use both as for i in range (row) first and for j in range (col) next
Clear my doubt Sisy...
For your first question :
If I use [0 for i in range(5)] we will get [0,0,0,0,0]
Now we got one row and 5 column and now if we want to print this in 4 rows then we need to take another for loop for that.
[[0 for i in range(5)] for j in range(4)]
I is column here and j is row.
So first take for loop for column then take for loop to print how many row you want 😊
Now for the second question:
Here we want to print
row0 col0 col1 col 2 col3 col4
After that we need to go to second row (row1)
That’s why here outer for loop is for loop for row and inner for loop is for loop for column 😊
@@AmulsAcademy I understand first one. But not second
if we giving the negative value it showing error, how we write global solution.
Sisy...can you please explain each and every line with a example plzzzxx
Each line explanation for matrix addition and subtraction .?
thank you so much
Can we write this:
matrix1=[ [ int( input( ) ) for i in range(row) ] for j in range(col) ]
insteaad of
matrix1=[ [ int( input( ) ) for i in range(col) ] for j in range(row) ]
If not then what is the reason behind this?
You can write like this but you will get row number of column and col number of row in your output :)
Can anyone help me with 3 line! I am confused of why 'col' is taken first in 'for' loop! 'for' loop works for eg.:
#
for i in [1,2]:
for j in [3,4,5]:
print([i][j])
#
Output: [[1,3], [1, 4], [1, 5], [2,3]...]
_______
If I need to input 2×3 matrix, why can't I put "row" in first "for" loop?
i will explain this with list comprehension.
when you take [0 for i in range(5) ] we will get output as [0,0,0,0,0]
this is 1×5 array/list here, now if i want 3×5 list then i need to [0 for i in range(5) ]repeat this thrice/we need to loop this thrice.
[[0 for i in range(5) ] for j in range(3)].
@@AmulsAcademy How it will look using regular for loops ma'am?
Thanks
Amulya can u please make a video on stack ,linkedlist, queues...in python
I will try :)
@@AmulsAcademy no one had made a video on python data structure..u make a video it is useful for every one .. tq mam thanks for ur reply
In list comprehension why we are giving Column first?
So that we can use matrices which are not necessarily square
@@mananchawla4751 how? can you explain step by step?
Mam I am unable to follow this so can I use Numpy insted of this
Yes :)
You're amazing✌
very good
At time line 5min why you use "
To print values of matrix in a proper manner here i am formatting the values.
To know more learn about format()
Madam,please expalin the list comprehension of matrix1 varaible.I seen the previous videos of list comprehension,This kind of example not present in the previous list comprehension video
[[int(input()) for i in range(col)] for j in range(row)]
here first
[int(input()) for i in range(col)] this will be executed.
if i enter col as 4, it will take 4 value for column. { 4 times it will execute int(input()) and we will get 4 integer input }
Next,
for j in range(row)
this for loop will execute.
it will run
[int(input()) for i in range(col)]
this row times {if row is 3 it will run for loop 3 times.}
Thank U madam for your kind Replay
Hi amulya , can u pls make a video on functions ..u have made basic video ..pls make a video on....how functions can be called inside a function .how var in one functn n accessed with other function in python ...it's a request ,
Watch closures video in amuls academy
why do in list comprehension does column for loop comes first and row for loop second while printing its the opposite? also massive respect to you me lady
if you use single list
[ 0 for i in range(5)] it will create [0,0,0,0,0]
that is the one row right now if i want 4 rows like that i need to write
[[0 for i in range(5)] for j in range(4)]
:)
Thank you 🙂🙏🇮🇳
Why we are using "end"???
To print the number in same line :)
Mam...If we didn't use end it will print one by one ah..
@@charu4963 yes it will print one by one
Because by default...end 's value is new line.. we need to give space " " so that it's printed in same line. If u have given 2 it would have printed 2 after every number
phypythonics.wordpress.com/contents/
You can check out the website
Mam please consider the programs with lesser time complexity!
Sure :)
Thank you.
Could you please explain the for loop logic :
[[int(input()) for i in range(col)] for j in range(row)]
When you use
[int(input()) for i in range(col)]
it will given you a list with values.
for example
col=3
if i enter input as 0
then we will get [0,0,0] as output.
but here we want nested list for matrix because matrix is 2d so we will use nested list here.
[[int(input()) for i in range(col)] for j in range(row)]
if row=4
then i will get
[0,0,0] 4 times.
[[0,0,0],[0,0,0],[0,0,0],[0,0,0]]
:)
@@AmulsAcademy Thank you for your quick response :)
@@AmulsAcademy if row =4
0
0
0
0
Like this only??? Am I correct???
@@gayathri-8-i6s yes but we can use [[int(input()) for i in range(row)]for j in range(col)]
Or we can use
[[Int(input()) for i in range(col)]for j in range(row)]
We can use both output is same
@@karthikeyan-gy8tn thanks a lot
Madam,I cant understand the List comprehension can you please tell me in detail in the comment box
I made few videos on list comprehension you can watch that :)
th-cam.com/video/17gTGqHG5xQ/w-d-xo.html
th-cam.com/video/fnJOBQbc7Qg/w-d-xo.html
th-cam.com/video/JEapLNRuzVo/w-d-xo.html
:)
plzz start java programme language tutorial
can u post the code
I keep getting an error saying that the INT is not subscriptable
This video is somewhat confusing me... Can you explain each and every for loop plz....
I will give you simple tip
Write down the program in a paper and trace the program, you will understand the flow of the programs 😊
In the 4 line... i in range col and j in range row.. Ana next line la... i in range row and j in range in col.. Nu iruku.... Athu konjam explain paniringala
Thank you madam
You’re welcome 😊
We can also do it easily using numpy.
Sir if two matrices are given and we want to add them what is the code for that???
can you pleas explain the concept of end=' '
end is the parameter in the print(), default value is
that is new line.
when i write
print("hello")
it will print message hello and goto the next line {because default value of end = "
"}
But if we want print stars or number in the same line then we can use end=""
:)
Thank you so much
Tedious approach
Gosh
In list comprehension.
for i in range(col) for j in range(row)
but i is for row and j is for col?
is it condition to make row=col?
i and j are variables you can take any variable name here .
:)
@@AmulsAcademy got it thanks.
please make a playlist for *Django*
Voice ❤️💃
OMG
why does this video even has dislikes
😊😊
Wowwww
Thank you :)