🐍
পাইথন বেসিক
  • পরিচিতি
  • ইনস্টলেশন
  • ব্যাসিক কনসেপ্ট
    • পাইথন এর জন্য সেটআপ visual studio code
    • প্রথম প্রোগ্রাম রান করি
    • print ফাংশন
      • প্রিন্ট ফাংশনের প্যারামিটার
    • Comment
      • DocString
      • comment এবং docstring এর পার্থক্য
    • আইডেন্টিফাইয়ারস
  • স্ট্রিং (Strings)
  • ভেরিয়েবল
    • কন্সট্যান্টস (constants)
  • String Formating
  • ব্যবহারকারীর ইনপুট (user input)
  • Python Statement
  • indentation
  • ডেটা টাইপ
    • টাইপ কনভারশন
    • List
  • Python Operator
    • Arithmetic Operators
    • Comparison Operators
    • Logical Operators
    • Identity Operators
    • Membership Operators
    • Assignment Operator
  • Python Flow Control
    • if,else স্টেটমেন্ট
  • ফাংশন
  • ব্যক্তিগত ফাংশন
  • for লুপ
  • while লুপ
  • পাইথন মডিউল (Python module)
    • মডিউল ইম্পোর্ট করা (import Module )
      • Import from another folder
  • পাইথন প্যাকেজ ইনস্টল
  • প্যাকেজ তৈরি
  • এক্সেপশন হ্যান্ডেলিং
  • PIP
  • ফাইল হ্যান্ডেলিং
  • Databse
    • sqlite3
  • PrettyTable
  • Print Coloured Text At Python
Powered by GitBook
On this page

ব্যক্তিগত ফাংশন

সিম্পল ফাংশন:

def greet(name):
    return f"Hello, {name}!"

person_name = "Alice"
greeting = greet(person_name)
print(greeting)

ফাংশনে একাধিক প্যারামিটার:

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

result = add_numbers(5, 7)
print(result)

ডিফল্ট আর্গুমেন্ট:

def greet_with_default(name="Guest"):
    return f"Hello, {name}!"

greeting1 = greet_with_default()
greeting2 = greet_with_default("Bob")
print(greeting1)
print(greeting2)

ভ্যারিয়েবল আর্গুমেন্ট লিস্ট (অপরঃ অর্গুমেন্ট):

def multiply(*numbers):
    result = 1
    for num in numbers:
        result *= num
    return result

product1 = multiply(2, 3, 4)
product2 = multiply(5, 6, 7, 8)
print(product1)
print(product2)

ভ্যারিয়েবল আর্গুমেন্ট ডিকশনারি (কীঃ ভ্যালু):

def print_person_info(**info):
    for key, value in info.items():
        print(f"{key}: {value}")

print_person_info(name="Alice", age=25, city="New York")
PreviousফাংশনNextfor লুপ

Last updated 1 year ago