Answers for "fun with python"

5

function in python

#A function is a block of code which only runs when it is called.
#You can pass data, known as parameters, into a function.
#following is a simple function
def exmple_of_function():
  print("Hello from a function")

example_of_function()
Posted by: Guest on June-30-2021
3

how to define functions in python

def add(number):
  equation = 5 + number
  print(equation)
  
 
add(10)

output:
  
  15
Posted by: Guest on September-20-2020
0

python function

# Defines Function
def my_function():
  print("Hello")
  print("Bye")

# Calls Function
my_function()
Posted by: Guest on February-23-2021
0

python functions

#Functions
def string():
  print('This is a function')
  
  print(string())
Posted by: Guest on October-04-2020

Browse Popular Code Answers by Language