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.