Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Code isnt working
#1
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.

My code:

def powerTo(double, int):
if int>=0
return double**int
else:
return 0

any idea why its not working?
Reply


Messages In This Thread
Code isnt working - by abdullahali - Sep-28-2018, 02:25 AM
RE: Code isnt working - by buran - Sep-28-2018, 04:46 AM
RE: Code isnt working - by Skaperen - Sep-28-2018, 05:09 AM
RE: Code isnt working - by ichabod801 - Sep-28-2018, 12:01 PM
RE: Code isnt working - by gruntfutuk - Sep-29-2018, 09:34 AM
RE: Code isnt working - by Skaperen - Oct-01-2018, 02:31 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Getting my choices to display fro some reason it isnt working. dgizzly 5 1,372 Oct-24-2022, 04:53 PM
Last Post: DeaD_EyE
  Python code not working garvind25 1 2,776 Jun-24-2020, 09:38 PM
Last Post: Yoriz
  Please help me get this code working that i haven't posted yet damnit 3 2,461 May-22-2019, 09:57 PM
Last Post: Yoriz
  Homework Teacher isnt helping need some help randyearthchild 2 2,927 Nov-05-2017, 11:32 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020