Sample Input 1 10 4 Sample Output 1 Enter b: Enter a: *** ***** ***a*** ***aaa*** ***aaaaa*** ***aaaaaaa*** *************** ***************** *******************

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

  • Ask the user for two positive integer inputs a and b
  • Keep asking for inputs until all conditions below are satisfied:
    • b should be greater than 0
    • a should be greater than 0
    • b should be greater than a
  • (b-a) should be an even number
  • Print an isosceles triangle of asterisks (*) with height equal to b
  • Inside the big isosceles triangle of height b, there should be a smaller isosceles triangle with height a
    • The smaller triangle should be located at the center of the bigger triangle
    • The smaller triangle should be made of the letter "a"

Input Format

  • b - integer
  • a - integer

Constraints

  • Keep asking for inputs until all conditions below are satisfied:
    • b should be greater than 0
    • a should be greater than 0
    • b should be greater than a
  • (b-a) should be an even number

Output Format

Triangle ASCII art with asterisks and the letter "a"

Sample Input 0
1
01
1
5
4
5
3
Sample Output 0
Enter b: Enter a: Invalid input.
Enter b: Enter a: Invalid input.
Enter b: Enter a: Invalid input.
Enter b: Enter a: Invalid input.
Enter b: Enter a:
*a*
*ааа*
*ааааа*
*********
Transcribed Image Text:Sample Input 0 1 01 1 5 4 5 3 Sample Output 0 Enter b: Enter a: Invalid input. Enter b: Enter a: Invalid input. Enter b: Enter a: Invalid input. Enter b: Enter a: Invalid input. Enter b: Enter a: *a* *ааа* *ааааа* *********
Sample Input 1
10
4
Sample Output 1
Enter b: Enter a:
***
*****
***a***
***aaa***
***aaaaa***
***aaaaaaa***
***
**********
****
**
***********
*****
Transcribed Image Text:Sample Input 1 10 4 Sample Output 1 Enter b: Enter a: *** ***** ***a*** ***aaa*** ***aaaaa*** ***aaaaaaa*** *** ********** **** ** *********** *****
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 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