Lesson 16 of 34

Lists: एकाच ठिकाणी अनेक values

9 min 25 XP

40 विद्यार्थ्यांच्या marks साठी 40 variables नकोत! list अनेक values क्रमाने ठेवते. त्या [ ] मध्ये commas ने वेगळ्या करून लिहा.

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]. पहिला mark, शेवटचा mark आणि एकूण किती marks आहेत, प्रत्येक स्वतंत्र ओळीत print करा.

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