1. Write a program that has a loop to read in five strings and put them...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Write a program that has a loop to read in five strings and put them into a list. Write a second loop to print the strings in the reverse order. This is an exercise in indexing, so do not use the reverse() method of list. Print the index in the following format. The actual strings you read in are arbitrary. Example format when running q1.py: Enter string 1/5: the blue moon Enter string 2/5: the red guitar Enter string 3/5: go home Enter string 4/5: spill the beans Enter string 5/5: winter in Oklahoma String 5/5: winter in Oklahoma String 4/5: spill the beans String 3/5: go home String 2/5: the red guitar String 1/5: the blue moon 1. Write a program that has a loop to read in five strings and put them into a list. Write a second loop to print the strings in the reverse order. This is an exercise in indexing, so do not use the reverse() method of list. Print the index in the following format. The actual strings you read in are arbitrary. Example format when running q1.py: Enter string 1/5: the blue moon Enter string 2/5: the red guitar Enter string 3/5: go home Enter string 4/5: spill the beans Enter string 5/5: winter in Oklahoma String 5/5: winter in Oklahoma String 4/5: spill the beans String 3/5: go home String 2/5: the red guitar String 1/5: the blue moon
Expert Answer:
Answer rating: 100% (QA)
Below is the Python 3 code to read in ten strings from the user store them in a list and then print ... View the full answer
Related Book For
Smith and Roberson Business Law
ISBN: 978-0538473637
15th Edition
Authors: Richard A. Mann, Barry S. Roberts
Posted Date:
Students also viewed these programming questions
-
In this project, we will write a program that controls a quiz show, much like the many popular TV shows. The program will read in a group of questions and their multiple choice answers, storing them...
-
Please answer the following. Show your calculations for potential partial credit. Assume the expected return on the market is 14 percent and the risk-free rate is 4 percent. A.)What is the expected...
-
1. Simulate 10 free-throws for Kobe Bryant, whose career free throw average is 84%. How many of the shots were successful? 2. A baseball player is a .331 hitter. Simulate 10 at-bats for this player,...
-
A firm in monopolistic competition that is maximizing profit ________. A. Always makes a positive economic profit in the short run B. Never needs to shut down because its price always exceeds minimum...
-
What is the average power delivered when you raise a \(2-\mathrm{kg}\) object by \(50 \mathrm{~cm}\) in \(50 \mathrm{~ms}\) ?
-
Kao Tiles, Inc. is a specialized producer of ceramic tiles. Its production process involves highly skilled workers and top-quality ceramic craftsmen. Work in Process is relatively large because each...
-
We have defined a PyTorch network class DAN for you. You need to implement the forward pass for your deep averaging network. To start, first implement average that averages the words in a review and...
-
Complete the following chart.
-
1. [12 points] This problem uses the RISC-V program fragment below. L1: addi x12, x0, 5 add x11, x0, // x11 = 0 // x19 = 0 add x19, x0, addi x20, x0, 150 bge x11, x12, Exit slli x13, x11, 3 add x14,...
-
The Current Leadership Events assignment which you apply course content to a current event and a leader of your choice. The purpose of this is to apply course concepts and theories to a real-life...
-
According to Lacey, in regime conditions (A) Silt is kept in suspension by vertical components of eddies (B) Entire cross-section of the channel is generated at all points by the forces normal to the...
-
When a piece of wood is distorted by a karate chop, the top of the board is compressed while the bottom is stretched as shown. Therefore, you must first consider the change in length of the bottom of...
-
What current economic conditions might affect the credit rating of a team or league? Which teams credit ratings might be most negatively affected during a recession?
-
Question 28 How many Faradays are required to reduce 10g of iron(II) to iron metal? (1 point) (Ining 1) 0.05 F 0.36 F 1.33 F 2.45 F Question 29 How many Faradays are required to oxidize 120g of Zn(s)...
-
What is your assessment of the negotiations process, given what you have studied? What are your recommendations for Mr. Reed? You must justify your conclusions
-
Brown enters into a written contract with Ideal Insurance Company under which, in consideration of her payment of the premiums, the insurance company promises to pay State College the face amount of...
-
National Cash Register Company (NCR), a manufacturer of cash registers, entered into a sales contract for a cash register with Edmund Carroll. On November 18, Firestone and Company made a loan to...
-
The Gerwitz family resides on a piece of land known as Lot #24 of the Belleville tract, which they acquired by deed in 1992. Shortly thereafter, the Gerwitzes began to use the adjacent vacant Lot...
-
A running mountain lion can make a leap 10.0 m long, reaching a maximum height of 3.0 m. a. What is the speed of the mountain lion just as it leaves the ground? b. At what angle does it leave the...
-
In the 2016 Olympics in Rio, after the 50 m freestyle competition, a problem with the pool was found. In lane 1 there was a gentle 1.2 cm/s current flowing in the direction that the swimmers were...
-
A soccer player takes a free kick from a spot that is 20 m from the goal. The ball leaves his foot at an angle of 32, and it eventually hits the crossbar of the goal, which is 2.4 m from the ground....
Study smarter with the SolutionInn App