Sunday, June 4, 2017

Square a Number in Python

A very simple program that I wrote using Python to ask the user to give a number and then our program will compute the square equivalent of the given number by the user.

Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.



Sample Program Output


Program Listing

square.py

print("\n")
print("Square a Number in Python")
print("\n")
num = int(input("Enter a number: "))
square = num * num
print("\n")
print("The square value of {0} is the number is {1} ".format(num,square))
print("\n")
print("End of Program")

No comments:

Post a Comment