Using while loop or for loop to write a script p3.py that reads an integer value n and a string str from the user's input and then produces a 2n-1-column block, repeatedly. For the 2n-1-column output, the first column contains 1 str at the bottom, the second column contains 2 strs at the bottom, and so on until the n-th column, which contains exactly n strs. And the remaining n-1 columns will be the reverse of the first n-1 columns. The script will keep asking the user to input an integer value n and a string s and then print the corresponding 2n-1-column block. The script will print the line Program ends. and exit if the user inputs any integer less than 1. For this exercise, you don't need to check whether the user's input is an integer or not also you don't need to consider that a very long input Would rcrou tho format A camplo run chould bo ar follour:

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Please do this in python programming 

Using while loop or for loop to write a script p3.py that reads an integer value n and a
string str from the user's input and then produces a 2n-1-column block, repeatedly. For
the 2n-1-column output, the first column contains 1 str at the bottom, the second column
contains 2 strs at the bottom, and so on until the n-th column, which contains exactly n
strs. And the remaining n-1 columns will be the reverse of the first n-1 columns. The
script will keep asking the user to input an integer value n and a string s and then print the
corresponding 2n-1-column block. The script will print the line Program ends. and exit if
the user inputs any integer less than 1. For this exercise, you don't need to check whether
the user's input is an integer or not also you don't need to consider that a very long input
would screw the format. A sample run should be as follows:
Enter an integer :4
Enter a string:1
1
111
11111
1111111
Enter an integer:2
Enter a string:^_^
Enter an integer:0
Program ends.
Transcribed Image Text:Using while loop or for loop to write a script p3.py that reads an integer value n and a string str from the user's input and then produces a 2n-1-column block, repeatedly. For the 2n-1-column output, the first column contains 1 str at the bottom, the second column contains 2 strs at the bottom, and so on until the n-th column, which contains exactly n strs. And the remaining n-1 columns will be the reverse of the first n-1 columns. The script will keep asking the user to input an integer value n and a string s and then print the corresponding 2n-1-column block. The script will print the line Program ends. and exit if the user inputs any integer less than 1. For this exercise, you don't need to check whether the user's input is an integer or not also you don't need to consider that a very long input would screw the format. A sample run should be as follows: Enter an integer :4 Enter a string:1 1 111 11111 1111111 Enter an integer:2 Enter a string:^_^ Enter an integer:0 Program ends.
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education