Make a program using python that runs like these examples (triangle inside a triangle): Enter a: 3 Enter a: 10 Enter b: 0 Wrong Input. Enter b: 4 Enter a: 3 Enter b: 3 Wrong Input. Enter a: 7 Enter b: 8 Wrong Input. Enter a: 9 Enter b: 4 Wrong Input. Enter a: 3 Enter b: 7 Wrong Input. Enter a: 1 Enter h: 1 000 00000 0001000 000111000 00011111000

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Make a program using python that runs like these examples (triangle inside a triangle):
Enter a: 3
Enter b: 0
Wrong Input.
Enter a: 3
Enter b: 3
Wrong Input.
Enter a: 7
Enter b: 8
Wrong Input.
Enter a: 9
Enter b: 4
Wrong Input.
Enter a: 3
Enter b: 7
Wrong Input.
Enter a: 1
Enter b: -1
Wrong Input.
Enter a: 5
Enter b: 3
Enter a: 10
Enter b: 4
000
00000
0001000
000111000
00011111000
0001111111000
000000000000000
00000000000000000
0000000000000000000
010
01110
0111110
e00000000
Sample Input 1
Sample Input 2
• There will be 2 inputs: input a and input b.
o input a and input b must be greater than zero.
o inputa must be greater than input b
o (a-b) must be an even number
print "Wrong Input." and keep asking for 2 inputs if they don't satisfy the criteria in bullet 1.
Make an isosceles triangle of zeros (0) with height equal to a
Make a smaller isosceles triangle of ones (1) with height equal to b
o Must be located at the center of the larger triangle
Transcribed Image Text:Make a program using python that runs like these examples (triangle inside a triangle): Enter a: 3 Enter b: 0 Wrong Input. Enter a: 3 Enter b: 3 Wrong Input. Enter a: 7 Enter b: 8 Wrong Input. Enter a: 9 Enter b: 4 Wrong Input. Enter a: 3 Enter b: 7 Wrong Input. Enter a: 1 Enter b: -1 Wrong Input. Enter a: 5 Enter b: 3 Enter a: 10 Enter b: 4 000 00000 0001000 000111000 00011111000 0001111111000 000000000000000 00000000000000000 0000000000000000000 010 01110 0111110 e00000000 Sample Input 1 Sample Input 2 • There will be 2 inputs: input a and input b. o input a and input b must be greater than zero. o inputa must be greater than input b o (a-b) must be an even number print "Wrong Input." and keep asking for 2 inputs if they don't satisfy the criteria in bullet 1. Make an isosceles triangle of zeros (0) with height equal to a Make a smaller isosceles triangle of ones (1) with height equal to b o Must be located at the center of the larger triangle
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY