Lesson 17 of 34

List Methods: కలపడం, తీసివేయడం, క్రమపరచడం

9 min 25 XP

append() చివర కలుపుతుంది, insert() ఒక స్థానంలో కలుపుతుంది, remove() ఒక విలువను తీసేస్తుంది, 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.