import newton

def square(number):
   print("not from the newton module")
   return number * number


num = 12
print("Square from newton.py: ")
print(newton.square(num))
print("Square from main program: ")
print(square(num))
Exemple #2
0
from newton import average, square, sqrt

num1 = 199
num2 = 78
#print("The average is " + str(average(num1, num2)))
#print(sqrt(9))
avg = average(num1, num2)
print("The average is " + str(avg))
print("The square of the average " + str(square(avg)))

print("Enter a number: ")
number = int(input())
print("the square root of " + str(number) + ' is ' + str(sqrt(number)))
#namespace
# C:\Users\lenovo\Desktop\2020\2020DeveloPython
import newton


def square(number):
    print("not from the newton module")
    return number * number


num = 12
print("From newton module")
print(newton.square(num))
print("From main process ")
print(square(num))
Exemple #4
0
from newton import average, square

num1 = 199
num2 = 78
#print("The average is " + str(average(num1, num2)))
#print(sqrt(9))
avg = average(num1, num2)
print("The average is " + str(avg))
print("The square of the average " + str(square(avg)))
import newton


def square(number):
    print "This is not from Newton !"
    return number * number


number = 9
print "The square of number is " + str(square(number))
print "The square of number is " + str(newton.square(number))
from newton import average, square

num1 = 199
num2 = 78
#print('The average is ' + str(average(num1, num2)))

#print(sqrt(9))

avg = average(num1, num2)
print('The average is ' + str(avg))
print('The square of the average ' + str(square(avg)))