0

WHY MY CODE IN JUPYTER NOTEBOOK IS DIRECTLY GOING INTO NEXT LINE WITHOUT EXECUTING..WHAT IS THE SOLUTION FOR THIS

with open('D:\\Courseera python\\Mod 1 Code & Data Files\\albumlist.csv','r') as csvfile: reader=csv.DictReader(csvfile) rows=101 for row in reader: rows=-1 if(rows>0): print(row) else: break

13th Jul 2023, 8:44 AM
Sabnis Ashutosh
Sabnis Ashutosh - avatar
2 Respuestas
+ 7
You set rows to -1. Note that "= -" is different from "-=". DID YOU NOTICE THAT YOUR CAPS LOCK IS ON?
13th Jul 2023, 9:29 AM
Lisa
Lisa - avatar
+ 5
What are you trying by this code? It will break loop at first iteration, without any output ....
13th Jul 2023, 9:59 AM
Jayakrishna 🇮🇳