Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please solve with FOR loops and conditional statements (IF statements) by Python. Please do not use BREAK, QUIT, RETURN commands. If you make a comment

image text in transcribedimage text in transcribed

Please solve with FOR loops and conditional statements (IF statements) by Python. Please do not use BREAK, QUIT, RETURN commands. If you make a comment of the commands, I will be appreciated. Thank you!

Write a program that prints a right-angled triangle and a "X" sign as follows: 1. As your first task, you will print a triangle whose border is made of "*" signs and the interior is "#". a. Ask the user for n, the number of lines with "#" signs. b. If n is less than 1, display a warning and proceed to the second task. c. If not, print the right angled triangle with n lines of "#". On each new line there should be one more "#" than the previous line. Note that the complete shape will have n+3 lines. See the sample output. 2. As your second task, you will print an X sign which is made of * signs. a. Ask the user for m, the number of lines of the X sign. b. If m is less than 3, display a warning and skip this task. c. If not, print the huge "X" sign made up of * characters. See the sample output. Sample screen output 1: Enter n: 5 #*#* Enter m: 7 Sample screen output 2: Enter n: 0 Invalid input. Enter m: 8 Sample screen output 3: Enter n: 10 *** **#* ###* ### ### Enter m: 2 Invalid input

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database 19c DBA By Examples Installation And Administration

Authors: Ravinder Gupta

1st Edition

B09FC7TQJ6, 979-8469226970

More Books

Students also viewed these Databases questions