Lesson 16 of 34

Lists: कई मान एक जगह

9 min 25 XP

40 विद्यार्थियों के अंकों के लिए 40 variables की ज़रूरत नहीं! list कई मानों को क्रम से रखती है। उन्हें [ ] के अंदर comma से अलग करके लिखें।

Example: edit me and press Run

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

index से किसी item को बदला जा सकता है। Slicing [start:stop] list का एक हिस्सा देता है (stop शामिल नहीं होता)।

Example: edit me and press Run

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

for loop list के हर item पर जाता है।

Example: edit me and press Run

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

एक list में अलग-अलग types हो सकते हैं: [1, "two", 3.0, True]

Challenge

+25 XP

marks = [78, 92, 65, 88]। पहला अंक, आख़िरी अंक और कुल कितने अंक हैं, हर एक अलग लाइन में print करें।

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