From b410c29a3908ab8e90a65667ec07e156588f544a Mon Sep 17 00:00:00 2001 From: Shubham Das <64020241+S-ctrl172@users.noreply.github.com> Date: Sun, 29 Sep 2024 00:30:03 +0530 Subject: [PATCH] Update Loops.py --- Python/Loops.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Python/Loops.py b/Python/Loops.py index 91e4d99..6a92eb6 100644 --- a/Python/Loops.py +++ b/Python/Loops.py @@ -1,4 +1,5 @@ -n = int(input()) +if __name__ == '__main__': + n = int(input()) # Read the integer input -for i in range(n): - print i ** 2 + for i in range(n): # Loop through the range + print(i ** 2) # Print the square of i