diff --git a/python3code/chapter02/forelse.py b/python3code/chapter02/forelse.py index daac13a..cc753b3 100644 --- a/python3code/chapter02/forelse.py +++ b/python3code/chapter02/forelse.py @@ -4,12 +4,15 @@ ''' from math import sqrt +""" +math is module/ library under python which can perform simple math operations. +""" -for n in range(99, 1, -1): - root = sqrt(n) - if root == int(root): +for n in range(99, 1, -1): # we are iterating the for loop starting from 99 with a diffrence of 1 and ends at 10 (including). + root = sqrt(n) # this will calculate the square root of n + if root == int(root):# we are checking data type print(n) - break + break # if condition not satisfy it will move out of loop else: - print("Nothing.") + print("Nothing.") # when above execution condition fails.