Ask the user for a positive integer (b). The input (b) must be GREATER than 0. Keep asking for an input until the condition below is satisfied. Print an isosceles triangle with a height equal to the input (b). For each row in the triangle, numbers should be printed in increments of 1 starting from 0. If the number is greater than 9, print the remainder when divided by 10 (number % 10) -- % is the modulo operator. Sample Input #1 Sample Input #2 [if the input (b) is less than 0.] -1 -100 Sample Input #2 Enter num: Sample Output #2 [if the input (b) is less than 0.] 012 Enter num: Invalid input Enter num: Invalid input Enter num: Invalid input 01234 0123456 Enter num:

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

Need help programming this using Python, am currently practicing so I will appreciate so much, thank you expert :D The program needed is in the image. However, the input must always be greater than 0. 

Sample input is : 4

Then the output will be:

      0

    012 

  01234 

 0123456

 

Ask the user for a positive integer (b).
The input (b) must be GREATER than 0. Keep asking for an input until the condition below is
satisfied.
Print an isosceles triangle with a height equal to the input (b).
For each row in the triangle, numbers should be printed in increments of 1 starting from 0. If the
number is greater than 9, print the remainder when divided by 10 (number % 10) -- % is the
modulo operator.
Sample Input #1
Sample Input #2 [if the input (b) is less than 0.]
4
-1
-100
1.
Sample Input #2
Enter num:
Sample Output #2 [if the input (b) is less than 0.]
012
Enter num: Invalid input
Enter num: Invalid input
Enter num: Invalid input
01234
0123456
Enter num:
Transcribed Image Text:Ask the user for a positive integer (b). The input (b) must be GREATER than 0. Keep asking for an input until the condition below is satisfied. Print an isosceles triangle with a height equal to the input (b). For each row in the triangle, numbers should be printed in increments of 1 starting from 0. If the number is greater than 9, print the remainder when divided by 10 (number % 10) -- % is the modulo operator. Sample Input #1 Sample Input #2 [if the input (b) is less than 0.] 4 -1 -100 1. Sample Input #2 Enter num: Sample Output #2 [if the input (b) is less than 0.] 012 Enter num: Invalid input Enter num: Invalid input Enter num: Invalid input 01234 0123456 Enter num:
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Similar 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