p
y
c
h
a
l
l
e
n
g
e
r
Home
Intermediate Python
Unpacking
Exercise: Unpack Tuples in a for-loop
Exercise: Unpack Tuples in a for-loop
Loop over
points
and unpack each tuple as
(x, y)
right in the loop header. Add both values to
total
.
Premium
reset
def greet(name): return f"Hello, {name}!" print(greet("Erik"))
Python
Setting up Python environment...
Output