You are viewing our Forum Archives. To view or take place in current topics click here.
Myprogramminglab python functions question
Posted:

Myprogramminglab python functions questionPosted:

Helix-Nebula
  • Rising Star
Status: Offline
Joined: Sep 04, 201013Year Member
Posts: 706
Reputation Power: 29
Status: Offline
Joined: Sep 04, 201013Year Member
Posts: 706
Reputation Power: 29
Im having trouble what it is asking?

[Functions >> functions and if statements] Write the definition of a function powerTo which recieves two parameters, a double and an integer. If the second parameter is positive, the function returns the value of the first parameter raised to the power of the second. Otherwise, the function returns 0.


What I have so far
def function powerTo(value1, value2):
   if value2 > 0:
      value1**2=value1
   else:
      return 0
#2. Posted:
Helix-Nebula
  • 2 Million
Status: Offline
Joined: Sep 04, 201013Year Member
Posts: 706
Reputation Power: 29
Status: Offline
Joined: Sep 04, 201013Year Member
Posts: 706
Reputation Power: 29
Nvm figured it out I was being real stupid
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.