Playing with Numbers in Python – 2

#---------------------------- Check whether a number is square number ------------------------

print("Check Square number")
print()
n =int(input("Enter the number:"))

sqr= n**(0.5)  # n** (1/2)

if(sqr== round(sqr)):
    print(n,"is square number")
else:
    print("Not square number")
#----------------------------  find the square of a number -----------------------------------

num = int(input("Enter a number : "))
sqr = num *num
print("The Square value of ",num,"is",sqr)
#----------------------------  find the square of a number (method 2) ------------------------

num = int(input("Enter a number : "))
sqr = num **2
print("The Square value of ",num,"is",sqr)
#----------------------------  find the square of a number (math module) ---------------------

import math   # pip install math 
num =int(input("Enter th enum: "))
sqr = int(math.pow(num,2))  # math.pow(number,power)
print("The square value of ",num,"is",sqr)
#----------------------------  find the square of all odd number in range---------------------

n = int(input("Enter no.of elements : "))
start = int(input("Enter the start "))
for i in range(start,start+n):
    if i%2 !=0:
        sqr= i **2
        print("The square value of",i,"is",sqr)
print('.....')  
#----------------------------  find the square of all evennumber in range---------------------

n = int(input("Enter no.of elements : "))
start = int(input("Enter the start "))
for i in range(start,start+n):
    if i%2 ==0:
        sqr= i **2
        print("The square value of",i,"is",sqr)
print('.....')

Join our team, where career growth knows no limits.

For More Details

Our internship program guarantees personalized attention for optimal career development in the tech industry.

+91 97879 68375

-> You should bring your own laptop during the internship

Who can apply?

Internships are open for students who: B.E / B.Tech / M.E / M.Tech / B.Sc / M.Sc / M.C.A / B.C.A / Diploma.

  • Ongoing Students Only
  • days, 5days/ 10days or Based on Student Preference
  • Limited 1 to 10 students per slot
  • Registration fees : 1000 INR
  • Slots are filling quickly only fewer slots are available