Jul-26-2019, 05:51 PM
I'm VERY new to programming and working with functions at the moment. I created the following
function and saved it in a file named exponent.py
function and saved it in a file named exponent.py
def exp(x,y): z = x ** y print(z)When I was watching the video, they only had to use the import command pull in their function. When I tried the same process, the script failed. I had to use the from/import syntax to get my script to work. Could this be due to them running an older version of Python (I'm running 3.7.4).
from exponent import exp base=int(input("value ")) exponent=int(input("exp ")) exp(base,exponent)