How do I need to fix my code and add in my code: - if user enters height less than 0 set default to 3? - if a character

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

How do I need to fix my code and add in my code: - if user enters height less than 0 set default to 3? - if a character

Post by answerhappygod »

How do I need to fix my code and add in my code:
- if user enters height less than 0 set default to 3?
- if a character doesn't enter a character choice how do I set
default to * ?
Below is the output I want:
How Do I Need To Fix My Code And Add In My Code If User Enters Height Less Than 0 Set Default To 3 If A Character 1
How Do I Need To Fix My Code And Add In My Code If User Enters Height Less Than 0 Set Default To 3 If A Character 1 (10.77 KiB) Viewed 32 times
How do I adjust my code?
How Do I Need To Fix My Code And Add In My Code If User Enters Height Less Than 0 Set Default To 3 If A Character 2
How Do I Need To Fix My Code And Add In My Code If User Enters Height Less Than 0 Set Default To 3 If A Character 2 (13.19 KiB) Viewed 32 times
Example 2 $ python3 hollow.py Enter height of triangle: +2 Character: *** Example 3 $ python3 hollow.py Enter height of triangle: #5 Character: + Example 4 $ python3 hollow.py Enter height of triangle: 5-2 Character: vi 1 11 11111
in = int(input("Enter height of triangle: #")) 2 if ne: n = 3 3 4 a = input("Character: #") 5 if a=!': a 6 71 8 9 while ice(n): 18 j= 11 while j<(n-i): 12 print(" ', end='') 13 14 while j<=(2+i+1): 15 if j==8 or j==2+or j==n-1: 16 print(f' {a}', end='') }'' 17 else: 18 print('' end='') 19 1=1+1 28 print)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply