LearnPy Hub
← Iterators & Generators problems
Medium

A Generator Runs Out

Read n. Make a generator expression of 1..n, print sum() of it, then sum() of the same generator again (it is used up).

Input

One integer.

Output

Two lines.

Sample 1

Input
10
Output
55
0

Sample 2

Input
1
Output
1
0
solution.py
Output appears here
A Generator Runs Out · Python practice problem · LearnPy Hub