+ 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
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?
+ 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. 🤷♂️
+ 2
What is the task? What does the question want you to print?
+ 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...
+ 2
If the task is to print out using slicing, then 2 isn't correct. You need
print(planets[2:3])
+ 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.
0
Print out.
Correct answer is 2.
But app. Said false
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
0
Hi can we do python