Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a Python program that will display the following menu to the user and read the users choice until user selects to exit the program.

Create a Python program that will display the following menu to the user and read the users choice until user selects to exit the program. Also make sure that your program takes care about any invalid input if it is other than 0-4.

1 : Check Pangram String

2 : List of positions of even numbers

3 : Encrypt the String

4 : Intersection of lists

0 : Exit

Menu option 1 Check Pangram String o You are to read a string from the user, check if the given string is pangram or not and display the message accordingly. o The pangram strings are those that contain each letter of English language alphabet (a-z) at least once.

Menu option 2 List of positions of even numbers o You are to consider a list of integer numbers. o Find the positions of even numbers from the original list, store the positions in a new list and display it.

Menu option 3 Encrypt the String o You are to read a string from the user. E.g. Python o Reverse the string. i.e. nohtyP o Generate and display a resultant string that will combine both the strings letter by letter. E.g. PnyothhtoynP

Menu option 4 Intersection of lists o Consider the two lists of integer numbers. o Find the numbers that are common to both the lists, store such numbers in a new list and display it.

Sample Run:

**************************************************

1 : Check Pangram String

2 : List of positions of even numbers

3 : Encrypt the String

4 : Intersection of lists

0 : Exit

**************************************************

Please enter your choice [0 to stop]: 1

Please enter string : The quick brown fox jumps over the lazy dog

Given input string is a pangram string

*************************************************

1 : Check Pangram String

2 : List of positions of even numbers

3 : Encrypt the String

4 : Intersection of lists

0 : Exit

**************************************************

Please enter your choice [0 to stop]: 1

Please enter string : It is a beautiful day

Given input string is NOT a pangram string

**************************************************

1 : Check Pangram String

2 : List of positions of even numbers

3 : Encrypt the String

4 : Intersection of lists

0 : Exit

**************************************************

Please enter your choice [0 to stop]: 2

List of numbers : [5, 10, 3, 14, 8, 11, 20, 71, 42, 62]

List of positions of even numbers : [1, 3, 4, 6, 8, 9]

**************************************************

1 : Check Pangram String

2 : List of positions of even numbers

3 : Encrypt the String

4 : Intersection of lists

0 : Exit

**************************************************

Please enter your choice [0 to stop]: 3

Please enter string : ZANIL

Original string : ZANIL

Reversed string : LINAZ

Output string : ZLAINNIALZ

**************************************************

1 : Check Pangram String

2 : List of positions of even numbers

3 : Encrypt the String

4 : Intersection of lists

0 : Exit

**************************************************

Please enter your choice [0 to stop]: 4

List 1 : [5, 10, 3, 14, 8, 11, 20, 71, 42, 62]

List 2 : [2, 14, 31, 15, 28, 10, 20, 11, 28, 62]

Intersection of List [10, 14, 11, 20, 62]

**************************************************

1 : Check Pangram String

2 : List of positions of even numbers

3 : Encrypt the String

4 : Intersection of lists

0 : Exit **************************************************

Please enter your choice [0 to stop]: 5

Invalid input **************************************************

1 : Check Pangram String

2 : List of positions of even numbers

3 : Encrypt the String

4 : Intersection of lists

0 : Exit

**************************************************

Please enter your choice [0 to stop]: 0

Terminating the program.

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

Database Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions