+ 1

# How many values will be extracted from the list??

Question : planets = ['Mercury', 'Venus', 'Earth', 'Mars', 'Jupiter'] print(planets[2:4]) Advanced thanks 🙂🥲

2nd Aug 2024, 3:31 PM
Rouza TN
8 Antworten
+ 6
Don't wait for people to do the task for you. RUN THE CODE BY YOURSELF AND SEE THE OUTPUT.
2nd Aug 2024, 3:35 PM
Lisa
+ 3
Tbh I often had problems myself with this kind of question. But it is easy: calculate the difference. 4-2=2
2nd Aug 2024, 6:53 PM
Oma Falk
+ 3
Read the previous replies. Don't guess. Run the code or learn about slicing.
2nd Aug 2024, 7:09 PM
Lisa
+ 2
Pat it'd be 2
3rd Aug 2024, 1:57 PM
Rouza TN
+ 1
Lisa thanks 🙂😄
2nd Aug 2024, 3:39 PM
Rouza TN
+ 1
Thanks for the correction, Rouza
3rd Aug 2024, 2:20 PM
Pat
0
I don't have knowledge in Python but I will try to guess as it's somehow similar with R. My answer is 3 values will be extracted from the list. Please correct me if I'm wrong.
2nd Aug 2024, 7:07 PM
Pat
0
@Lisa, I assume your recent reply was for me as I'm the only one who guessed the answer. I must be wrong then coz Oma Falk answer is 2, a trusted mentor. I just pitched in as it's like a fun guessing game for me with no knowledge of Python and slicing. I appreciate your tip, mentor Lisa .
2nd Aug 2024, 7:22 PM
Pat