python funtion

Solutions on MaxInterview for python funtion by the best coders in the world

showing results for - "python funtion"
Lucas
06 Jun 2020
1def myFunction(say): #you can add variables to the function
2  print(say)
3
4myFunction("Hello")
5
6age = input("How old are you?")
7
8myFunction("You are {} years old!".format(age))
9
10#this is what you get:
11
12Hello
13How old are you?
14>>11 #lol my real age actually
15You are 11 years old!
Alexia
01 Jan 2021
1def example():			#This defines it
2  print("Example.")		#This is the defined commands
3
4example()				#And this is the commands being run
Clementine
17 Apr 2019
1def myFunction():
2  print('I am running in a function!')
Lotta
22 Apr 2018
1# first we have to write 'def'
2# then our function name followed by ()
3# and a ':' abd defining  block of code
4
5def multiply():     # naming convention could be same as variable for functions
6    product = 10.5 * 4
7    return product
8
9
10product = multiply()
11print(product)
Bianca
07 Jun 2020
1def name():#name of the def(function);
2  print("Hallo, World!")#Output is Hallo, World!;
3  
4name()#Name of the def, the programm will jump to the def;
5
6#output:
7#Hallo, World!
Kaliyah
04 May 2020
1def nameOfFunction(something):
2  	return something
3
similar questions
queries leading to this page
python funtion