Problem # 2: >>> fruit = 'banana' >>> fruit[3:3] "" An empty string contains no characters and has length 0, but other than that, it is the same as any other string. Exercise: Given that fruit is a string, what does fruit[:] mean? Problem #3
Added by Laura S.
Close
Step 1
In Python, string slicing with `[:]` creates a copy of the entire string. Show more…
Show all steps
Your feedback will help us improve your experience
Akash M and 66 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
In python: Create a list array with 3 string values that are fruits. Print each letter of each fruit using nested for loops. Each letter will be on a new line and indented by one space; “ “. Each next word will start back at the left.
Akash M.
Madhur L.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD