Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assign variable fav _ drink with 'coffee' and read string least _ fav _ drink from input. Output the following: ' My favorite drink' followed
Assign variable favdrink with 'coffee' and read string leastfavdrink from input. Output the following:
My favorite drink' followed by favdrink, then 'has' followed by the length of favdrink, then 'characters', all separated by spaces.
My least favorite drink' followed by leastfavdrink, then 'has' followed by the length of leastfavdrink, then 'characters', all separated by spaces.
Click here for example
Ex: If the input is soda, then the output is:
My favorite drink coffee has characters
My least favorite drink soda has characters
Note: printa b c outputs variables a b and c separated by spaces in one line.
printMy least favorite drink', leastfavdrink, 'has', lenleastfavdrink 'characters'
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started