DEV Community

Payilagam
Payilagam

Posted on

Python - Functions

Functions: Datatypes:

Functions: +2: Python: செயல்கூறு:
Methods / Procedure - Sub Procedure /

Meyyazhagan:

Watching_Meyyazhagan:
1. Laptop On
2. Netflix
3. Meyyazhagan
4. Play

What is Functions:
Set of Instructions for achieving a specific task with a name

WHY do we need function: Reusable Code:

Actions: Verb: வினைச்சொல்
playing_chess
playing_carrom
cooking
swimming
reading
watching

Object: Noun: பெயர்ச்சொல்
carromboard
chessboard
laptop

Function:
input()
print()

input() --> Arguments / Parameter
print()

eat(food)
sleep()
walk()
cook(rice, water)
swim(dress, pool)
write_exam(hallticket, pen, paper, pencil, scale, rubber, question_paper)

Supporting Arguments: Comma Separated arguments

Functions: input, print

input: 1 Argument

print: 2 Arguments

predefined functions: input, print

User defined Functions:

Function:

() --> action

def calculate(no1, no2):
print(no1+no2)
print(no1-no2)
print(no1*no2)
print(no1/no2)

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay