how to do new break lines on a string on python
Added by Daniel F.
Step 1
For example, let's say you have the following string: ```python my_string = "Hello World! This is a test string." ``` Show more…
Show all steps
Your feedback will help us improve your experience
Akash M and 69 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
Akash M.
what is a string
Lijeesh K.
Three strings are read from input and stored into list produce. Then, three more strings are read from input and stored into list inventory. Lastly, string separator_char is read from input. Use five print(f' ') statements to output the following five lines: "Produce", with a field width of 12, centered, and followed by '|'. Then "Inventory", with a field width of 12, centered. 24 instances of separator_char. produce[0], with a field width of 12, centered, and followed by '|'. Then, inventory[0] with a field width of 12, centered. produce[1], with a field width of 12, centered, and followed by '|'. Then, inventory[1] with a field width of 12, centered. produce[2], with a field width of 12, centered, and followed by '|'. Then, inventory[2] with a field width of 12, centered.
Shu N.
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