python functions

0

Functions in Python

Program 1 #Program of Functions in Python # def factorial(): # f=1 n=int(input(“Enter a number”)) while(n!=0): f=f*n n=n-1 print(“Factorial is: “,f) # Main #factorial() #calling Program 2 # import TestFunction1 as tf # tf.factorial()...

0

How to Create Function in Python

Program 1 def display(): print(“Welcome in python function”) def addition(): a=int(input(“Enter first number”)) b=int(input(“Enter second number”)) c=a+b print(“Addition is : “,c) def sub(): a=int(input(“Enter first number”)) b=int(input(“Enter second number”)) c=a-b print(“Addition is : “,c)...