QuestionQ56

VerifiedPython Basics

What string is produced by the following command for the string variable gpyc?

Question Image

Question Image

Explanation

The slice gpyc[12:20] produces powerful. A reverse slice with a start index beyond the substring length is clipped to its final character, so [11::-1] reverses the complete substring to produce lufrewop.

Community Discussion

No comments yet. Be the first to start the discussion!