repl.it
@imnotyouraura/

square number calculator

Python

calculates many square numbers. not efficient if you want just one, but if you want many, this is a very efficient method.

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
print("Fancy Square Number Calculator >> By ImNotYourAura")
number_of_squares = int(input("How many square numbers would you like to be calculated: "))
squares_completed = 1
square_number_current = 1
square_number_difference = 3
for squares_completed in range(1,number_of_squares + 1):
  print("Square Number",squares_completed,": ",square_number_current)
  square_number_current = square_number_current + square_number_difference
  square_number_difference = square_number_difference + 2
  squares_completed = squares_completed + 1
Fetching token
?