+ 1

this q. is in correct .the code atteched

planets = ['Mercury', 'Venus', 'Earth', 'Mars'] print(planets[2:]) 3 1 2 ----------------- the correct answer is 2 but the progr. said not

28th Apr 2025, 5:53 AM
Omar Faramawy
Omar Faramawy - avatar
9 odpowiedzi
+ 7
This is from slicing in the Python beginners course. However, you're missing something, or I have a different question. There are 2 questions in the unit with planets. 1 is about how many planets will be printed and the other one is to print out our planet. Which question are you answering here?
28th Apr 2025, 6:23 AM
Ausgrindtube
Ausgrindtube - avatar
+ 4
Afnan, read the response from Omar. "Print out. Correct answer is 2. But app. Said false" He said it's the print out question, not the how many values question. To remove all ambiguity, it would be great to have a copied version of the question or a screenshot. 🤷‍♂️
28th Apr 2025, 3:39 PM
Ausgrindtube
Ausgrindtube - avatar
+ 2
What is the task? What does the question want you to print?
28th Apr 2025, 6:04 AM
Afnan Irtesum Chowdhury
Afnan Irtesum Chowdhury - avatar
+ 2
I found this: How many values will be extracted from the list? planets = ['Mercury', 'Venus', 'Earth', 'Mars', 'Jupiter'] print(planets[2:4]) 3 2 1 I tried it and picked 2 and it was correct. I'm using the Sololearn Android app. maybe you just need to close and reopen it...
28th Apr 2025, 9:34 AM
Bob_Li
Bob_Li - avatar
+ 2
If the task is to print out using slicing, then 2 isn't correct. You need print(planets[2:3])
28th Apr 2025, 2:31 PM
Ausgrindtube
Ausgrindtube - avatar
+ 2
Ausgrindtube ah yeah my bad, I got confused with the two windows of the lesson about the same list. Well, yeah you're right it is the one which asks to put index, since that one does not have Jupiter and the other one does.
28th Apr 2025, 5:53 PM
Afnan Irtesum Chowdhury
Afnan Irtesum Chowdhury - avatar
0
Print out. Correct answer is 2. But app. Said false
28th Apr 2025, 8:40 AM
Omar Faramawy
Omar Faramawy - avatar
0
Ausgrindtube wait what?...the task is how many values will be extracted from the list based on the code planets[2:4] as Bob_Li said, not what to put in the index
28th Apr 2025, 2:46 PM
Afnan Irtesum Chowdhury
Afnan Irtesum Chowdhury - avatar
0
Hi can we do python
29th Apr 2025, 5:39 PM
Vishal Chikwata
OSZAR »