Feedback for LID2 problem

Learning course: Learn Python
Problem Link: CodeChef: Practical coding for everyone

Feedback

solution :months = [“January”, “February”, “March”, “April”, “May”, “June”, “July”]

print(months[0:6])

print(months[1:5])

how 6 index is included i think this should be the solution

months = [“January”, “February”, “March”, “April”, “May”, “June”, “July”]
print(months[0:7])
print(months[1:6])

correct me if i am wrong

@shubhammudliar
our requirement is

    • Print the first 6 months of the year
    • Print the 2nd to 5th month of the year - both 2nd and 5th included
      Thus following solution is correct is the requirement.
# Solution as follows

months = ["January", "February", "March", "April", "May", "June", "July"]

print(months[0:6])

print(months[1:5])
1 Like

got it!