Functions in Python

📘 Python for Data Science 👁 71 views 📅 Nov 14, 2025
⏱ Estimated reading time: 1 min

Defining a Function

def greet():
    print("Hello!")

Function with Parameters

def add(a, b):
    return a + b

Default Arguments

def area(radius, pi=3.14):
    return pi * radius * radius

Keyword Arguments

print(area(pi=3.1416, radius=5))

Importance in Data Science

Functions help modularize tasks like:

  • Data cleaning
  • Feature engineering
  • Model evaluation

🔒 Some advanced sections are available for Registered Members
Register Now

Share this Post


← Back to Tutorials

Popular Competitive Exam Quizzes

🤖 AI Quizer Assistant

📝 Quiz
📚 Categories
🏆 Leaderboard
📊 My Score
❓ Help
👋 Hi! I'm your AI quiz assistant for Quizer.in!

I can help you with:
• 📝 Finding quizzes
• 🏆 Checking leaderboard
• 📊 Your performance stats

Type 'help' to get started! 🚀
AI is thinking...