I’m curious about this. Variables can store tuple,list,dictionary,numbers,strings etc. Here in the code…
sales_data = [[12, 17, 22], [2, 10, 3], [5, 12, 13]]
scoops_sold = 0
for location in sales_data:
for element in location:
scoops_sold += element
The element variable can store multiple numbers and it’s data type is int but when i try this method individually for eg.
abc = 1,2,3,4,5,6
This change the data type to tuple. How to assign multiple numbers to a variable and use the data type as Int?