#8: List Comprehensions | Hackerrank Python Solution | English Explanation

preview_player
Показать описание
All the videos of python hackerrank solution are available on channel
#listcomprehensionhackerranksolution #listcomprehensionhackerranksolutioninpython #listcomprehensionshackerrank #python #hackerranksolution #hackerrankpythonsolution
Рекомендации по теме
Комментарии
Автор

Thanks a lot❤️... I'm so confused what to do in this...now i got a clearance after watching this video..awesome great🤗👏

hareeshbabussj
Автор

Good Job Nihal but can you tell me the workflow in the program, how 6th link work?

anujgupta
Автор

Bro can you clarify to me why we are using +1 in this problem

vishyt
Автор

Hi how did you get to access the list elements I, j, k using its name itself(i+j+k!=0) is that possible ? because we could access the elements by its index value right?? then how could it posible

krishk
Автор

Great explanation ! 4:10 - should not be != 3 ;)

sujanshah
Автор

well explained bro you should use light mode for coding..

playkaraokesongs
Автор

The solution was really great but I am curious to know where I went wrong. Will you please help me :



*This is my code : *
x = int(input())
y = int(input())
z = int(input())
n = int(input())
coordinateList =[]
for i in range(x+1):
for j in range(y+1):
for k in range(z+1):
if(x+y+z!=n):
coordinateList.append([i, j, k])

print(coordinateList)


As an output entered I am getting all the coordinates even though I mentioned *if(x+y+z!=n):* while I am appending [x, y, z]

For example :
SAMPLE INPUT:
1
1
1
2
OUTPUT:
[[0, 0, 0], [0, 0, 1], [0, 1, 0], [0, 1, 1], [1, 0, 0], [1, 0, 1], [1, 1, 0], [1, 1, 1]]

CSBBADRIGAUTAM
Автор

How is that an “easy” task, im struggling so much trying to solve it

ziad
Автор

bro what's the use of this part __name__=='__main__' ??

sekirrom