def main():
number = int(input("Enter a number:"))
limit = square(number)
print("Counting up to", limit)
countto(limit)
def square(x):
'''Purpose: Compute the square of the number x.
Preconditions: x is an integer or float.
Postconditions: Returns a positive number of the same type as x.'''
return x ** 2
def countto(number):
'''Purpose: Print the numbers from 1 up to number.
Preconditions: number is an integer.
Postconditions: Prints the numbers from 1 to number, separated by
commas, and with a newline at the very end.'''
for i in range(1, number):
print(i, end = ", ")
print(number)
main()