Skip to content

Instantly share code, notes, and snippets.

@jumbojet
Last active December 23, 2015 17:19
Show Gist options
  • Save jumbojet/6667505 to your computer and use it in GitHub Desktop.
Save jumbojet/6667505 to your computer and use it in GitHub Desktop.
// Function that takes two integer (alredy declared as Intgers so as compiler can undertand) as input and
// Returns a output again of type integer
int add(int a , int b){
// Here also variable c is declared as Integer , any other type which compiler can not convert to like
// will give error
int c = a + b
return c
}
# Python Program doesn't declares the type of variables and neither it provides the return type.
# The way the output of the function is handled defines the type it returns
def add(a,b):
# Here also if we see variable c is not assigned any type it assumes the type of a+b
c = a+b
return c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment