Lesson 17 of 34

List Methods: যোগ, বাদ, Sort

9 min 25 XP

append() শেষে যোগ করে, insert() নির্দিষ্ট জায়গায় যোগ করে, remove() একটি value মুছে দেয়, আর pop() শেষ item বের করে নেয়।

Example: edit me and press Run

Output Loading Python (first time takes a few seconds)
Press Run to see the result here.

সংখ্যার list-এ sum(), max() এবং min() খুব কাজের। sort() ছোট থেকে বড় সাজায়; sort(reverse=True) উল্টোটা করে।

Example: edit me and press Run

Output Loading Python (first time takes a few seconds)
Press Run to see the result here.

এক লাইন থেকে অনেক সংখ্যা পড়তে: input().split() strings-এর একটি list দেয়; প্রতিটিকে int-এ বদলান।

Example: edit me and press Run

Output Loading Python (first time takes a few seconds)
Press Run to see the result here.

Challenge

+25 XP

Space দিয়ে আলাদা সংখ্যার একটি লাইন দেওয়া আছে (Input box দেখুন)। সবচেয়ে বড় ও সবচেয়ে ছোটটির পার্থক্য (max - min) print করুন।

Output Loading Python (first time takes a few seconds)
Press Run to see the result here.