Jump to content

Recommended Posts

Posted

Sir, can I declare a Function with its return type and parameter's type on Python like C Language?

void main()
{
  void sum(int,int); /*function declaration*/
  sum(5,5);
}

void sum(int x,int y)/*function defination*/
{
  /*function body*/
  int result;
  result=x+y;
  printf ("The Sum is %d",result);
}

Can i do this same code on python? Python support Function Declaration? If yes, then how i declare a function on python

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...