Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable update in loop #10

Open
mlhoutel opened this issue Nov 30, 2023 · 0 comments
Open

Variable update in loop #10

mlhoutel opened this issue Nov 30, 2023 · 0 comments

Comments

@mlhoutel
Copy link
Owner

test_list = [12, 67, 98, 34]

res = []
for ele in test_list:
    sum = 0
    for digit in str(ele):
        sum += int(digit)
    res.append(sum) # <= here
 
print ("List Integer Summation : " + str(res))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant