Answers for "functions in python programming"

58

python functions

def myFunction(say): #you can add variables to the function
  print(say)

myFunction("Hello")

age = input("How old are you?")

myFunction("You are {} years old!".format(age))

#this is what you get:

Hello
How old are you?
>>11 #lol my real age actually
You are 11 years old!
Posted by: Guest on February-18-2020
4

python functions

# first we have to write 'def'
# then our function name followed by ()
# and a ':' abd defining  block of code

def multiply():     # naming convention could be same as variable for functions
    product = 10.5 * 4
    return product


product = multiply()
print(product)
Posted by: Guest on November-26-2020
19

create function in python

def myFunction():
  print('I am running in a function!')
Posted by: Guest on November-19-2019
10

python funtion

def nameOfFunction(something):
  	return something
Posted by: Guest on February-21-2020
0

functions in python programming

#Statements with pound sign are comments, just to guide. They wont be executed.
#Funtion Definition- Must include def
def my_Function():
#statements within a function, will be executed when the function is called
    print("Hello World!")
#Function Calling
my_Function()
Posted by: Guest on April-21-2021
0

function used in python

def hello():
  name = str(input("Enter your name: "))
  if name:
    print ("Hello " + str(name))
  else:
    print("Hello World") 
  return 
  
hello()
Posted by: Guest on February-10-2021

Code answers related to "functions in python programming"

Python Answers by Framework

Browse Popular Code Answers by Language