Write a Python program that prints all the numbers from 0 to n, inclusive, where n is a single integer input from the user.
Example 1:
Input: 5
Output: 0 1 2 3 4 5
Example 2:
Input: 2
Output: 0 1 2
You can use a for loop in combination with the range() function.
n = int(input())
for i in range(n+1):
print(i, end=' ')
NOTEOwing to browser caching, any code input into the Trinket IDE might carry over across page refreshes or when transitioning between different questions. To commence with a clean slate, either click on the 'Reset Button' found within the IDE's Hamburger icon (☰) menu or resort to using Chrome's Incognito Mode.