Question: In later chapters we will be doing more with strings after covering branching and looping, such as if the user entered a specific string (

In later chapters we will be doing more with strings after covering branching and looping, such as if the user entered a specific string (e.g., "yes" or "no"), then take a specific action, or looping through a bunch of rows from a file and processing those strings.
In this lab we are going to use some basic string functionality, such as indexing, f-strings, and concatenation to to write a stanza from the song Swingin' the Alphabet. Haven't heard of it? According to Wikipedia, it was in a short movie back in 1938(when swing music was more popular) and sung by the trio Moe Howard, Larry Fine, and Curly Howard, but was actually composed by Septimus Winner back in 1875 as "The Spelling Bee". There is a stanza for each letter of the alphabet (except the vowels).
The goal in this lab is to write a program that takes two inputs and generates a stanza from the song for the letter in the name at the index provided in the second input.
A common name, such as "Bian"
A position (index) in the string that identifies the letter for the stanza.
Example:
If the input is:
Bob
2
Then the output generated is:
B-A-bay
B-E-bee
B-I-bicky-bi
B-O bo
bicky-bi bo B-U bu
bicky bi bo bu
Note: The letters that change in each stanza are bolded to clarify. Your answer does not involve bolding.
Hint: The letter at the given index could be either upper case (e.g., the first letter in 'Bob'), or lower case (e.g., the last letter in 'Bob'). In the output you generate, sometimes the letter that changes (the bold letters in the example) are upper case, and sometimes they are
 In later chapters we will be doing more with strings after

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!