101k views
3 votes
What is the output for the following code? Enter the result in the blank.

>>> num = "abcdefghi"

>>> num[2:5]

User Chao Song
by
4.1k points

2 Answers

5 votes

Answer:cde

Explanation:this is the correction on odyssey!!

User Chadams
by
3.8k points
5 votes

Answer:

Cde

Step-by-step explanation:

Because if you look at abcdefghi, In programming you start with 0. So it would be a:0 b:1 c:2 d:3 e:4 f:5 g:6 h:7 i:8. So if you say 2:5, it would be from c to e. Because in programming you dont count the last letter which is 5 you use the letter right before 5 to end it. Sorry its a bit confusing. But im 100% sure its right.

User Shonali
by
4.3k points