SubhanUllah Posted September 26, 2022 Report Posted September 26, 2022 n = int(input("What is N?")) my_list = [*range(1,n+1)] sum = 0 for number in my_list: sum += number print ("The sum from 1 to {:,} is {:,}".format(n,sum) ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.