p
y
c
h
a
l
l
e
n
g
e
r
Home
Python Basics
Time to Practice I
Sum of natural numbers
Sum of natural numbers
Write a function
sum_natural_numbers
that takes a positive integer
n
and returns the sum of all natural numbers from 1 to
n
.
Premium
reset
def greet(name): return f"Hello, {name}!" print(greet("Erik"))
Python
Setting up Python environment...
Output