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)

Reinvent your career. Join DEV.

It takes one minute and is worth it for your career.

Get started

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay