Python
Python copied to clipboard
PYTHON🐍 I am daily practising the python program but today using for loop and find out sum of what is prsent in list #python #coding #programminglanguage #engineering_in_kannada @mr_ayya_28 ✍️💪
l = [23,278,98,567,281,207] total = 0 for num in l: total = total+num print(total) 🚀💻
l = [23,278,98,567,281,207] # A list of integers total = 0 # Initialize a variable to store the sum for num in l: # Loop through each number in the list total = total + num # Add the current number to the running total print(total) # Print the final sum