Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USING PYTHON: A2) List Comprehension - String. Write a program that has 3 functions. The first function would ask for a user to enter a

USING PYTHON:

A2) List Comprehension - String. Write a program that has 3 functions. The first function would ask for a user to enter a word and it will save the word into a list then ask for next word to append to the list. Continue the process of word entry until user enter Q to stop data entry into the list. The function should return the list of words entered by user. (Example of words "democratic", "republican", "equal", "python", "break", "two", "ruby").

The second function will take a word as its argument and make it in upper case. The function returns this upper-case word.

The third function will take the list of words (output from first function) as an input argument then it creates a new list through list comprehension and using the second function to create new word list where all words are in upper-case. The function will return new upper-case-word list. The final step is to display third function output (print that new list). (Use list comprehension)

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 101

Authors: Guy Kawasaki

1st Edition

0938151525, 978-0938151524

More Books

Students also viewed these Databases questions

Question

How flying airoplane?

Answered: 1 week ago