Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python coding Requirements: Write code that prompts the user to input a positive integer as a number of rows and assign this input to a

Python coding

Requirements:

Write code that prompts the user to input a positive integer as a number of rows and assign this input to a variable. Assuming that the input presents an integer, convert the input string variable to an int and check if it is positive number. If its not positive, print an error message, else write eight methods (all of them with one argument the user input). Every method should provide an output like method_1: and a combination of stars (see illustration below assuming that the user input is 4):

1-a. The first method should print the following picture using the for loop:

*

*

*

*

1-b. The second method should print the following picture using the for loop:

*

**

***

****

1-c. The third method should print the following picture using the while loop:

*

*

*

*

1-d. The fours method should print the following picture using the while loop:

*

**

***

****

1-e. The fifth method should print the following picture using the for loop:

*

*

*

*

1-f. The sixth method should print the following picture using the for loop:

****

***

**

*

1-g. The seventh method should print the following picture using the while loop:

*

*

*

*

1-h. The eighth method should print the following picture using the while loop:

****

***

**

*

Write code that prompts the user to input a string and use it as a function argument. Implement a function that checks if this input string is a palindrome and returns corresponding boolean value. The palindrome check is not case sensitive (i.e. AbBA is a palindrome). Print out the result.

Note: Palindrome is a word, phrase, or sequence that reads the same backward as forward, e.g., madam or nurses run

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

Step: 3

blur-text-image

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

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

1951077083, 978-1951077082

More Books

Students also viewed these Databases questions