+ 1

Anyone explain me this code

I don't understand how 'For' loop work in this code https://code.sololearn.com/c7dQJydqi7q2/?ref=app

22nd Jan 2022, 4:42 PM
Liere
Liere - avatar
3 Answers
+ 4
Lier Ya correct Maharnab Saikia but u don't explained a[i]... Let me explain... a[i] or a[19] is temporary variable in last for loop as [for i in x] just like normal so it give values of list but in last it will show 18th elements two times because a[19] is already set to temporary variable
25th Jan 2022, 3:46 AM
Pallavi Bhardwaj
Pallavi Bhardwaj - avatar
+ 4
Lier Hope it help u to understand 😊
25th Jan 2022, 3:46 AM
Pallavi Bhardwaj
Pallavi Bhardwaj - avatar