Sharp Tutorial
Function overloading in Python

Python

Java

C

C++

HTML/CSS

Java Script

PHP

SQL

C Programs

Introduction to Python

  • Introduction to Python
  • History of Python
  • How To Install Software
  • Variables in Python
  • Comments in Python
  • Input/Output
  • If else in Python
  • While Loop
  • For Loop

Collection in Python

  • Numbers in Python
  • List
  • Tuple
  • Set
  • Dictionary
  • Array
  • String

Object Oriented python

  • Function
  • Exception
  • OOPS (class/object)
  • Object Pass & Return
  • Constructor
  • Function Overloading
  • Module in Python
  • Inheritance
  • File Handling

Python With MYSQL And Excel

  • Connect MySql & Python
  • Insert Data MySQL
  • Delete/Update MySQL
  • Select Data From MySQL
  • Working With Excel in Python

Python GUI

  • GUI using Turtle
  • Introduction to Tkinter
  • Login Page using Tkinter
  • Data Grid Example Tkinter
  • Connect Multiple Forms
  • Database with GUI Python

Programs in Python

  • Swap two number
  • Calculate the area
  • Even Odd or Zero
  • Largest ,Middle and Smallest Number
  • Calculate Telephone Bill
  • Print Table of The given Number
  • Factorial of the number
  • Reverse and check number is palindrome
  • check number is prime , armstrong
  • Program to Print the given patterns
  • Guess A Number Game using Random

Function Overloading in Python

In python same name function may be defined within the class or outside but last function overwrite the previous functions .In python same name function with same arguments may also be declared in but not possible in java c++ etc.

def display(age):
  print(“age=”,age)

def display(name,age):
  print("name=",name," age=",age)

# display(26)  it will give error as last function takes two argument and we pass here only 1 arugment.

display(‘john’,25)  # second function executes which takes only 1 arg

   Output:
    name=john  age=25

Similaryly overloading may be in the class as following

class Area:
def areaCal(self,a,b):
  area=a*b
print("area=",area)

def areaCal(self,a):
area=a*a
print("area=",area)

a1=Area ()

# a1.areaCal(10,20)  it will give error as last function takes only one argument and we pass here 2 arugments.

a1.areaCal(20) # second function executes which takes only 1 arguments

 

   Output:
Area=400

Enquiry about Course

Ask your Question

Click Here

Sharp (2) Tutorials

Video/ C Introduction

Watch video in full size

Video tutorial

Follow by Email
Facebook
Facebook
fb-share-icon
YouTube
Copyright © Sharp Tutorial
Build with WordPress
Wordpress Social Share Plugin powered by Ultimatelysocial
Sharp Tutorial