Write a python program that extracts a substring from the alphabet string based on the starting...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a python program that extracts a substring from the alphabet string based on the starting letter and the step. The step cannot be zero. The starting letter can be entered as lowercase or upper case. You need to validate the input as shown in the sample runs. Hint:use find method to get the index of the entered letter. Sample run 1: Enter starting letter: th You must enter one letter Sample run 2: Enter starting letter: $ You must enter one letter Sample run 3: Enter starting letter: T Enter step: 0 Step cannot be 0 Sample run 4: Enter starting letter: M Enter step: 3 Resulting substring is: mpsvy Sanmple run 5: Enter starting letter: t Enter step: -3 Resulting substring is: tqnkheb ( Write a python program that extracts a substring from the alphabet string based on the starting letter and the step. The step cannot be zero. The starting letter can be entered as lowercase or upper case. You need to validate the input as shown in the sample runs. Hint:use find method to get the index of the entered letter. Sample run 1: Enter starting letter: th You must enter one letter Sample run 2: Enter starting letter: $ You must enter one letter Sample run 3: Enter starting letter: T Enter step: 0 Step cannot be 0 Sample run 4: Enter starting letter: M Enter step: 3 Resulting substring is: mpsvy Sanmple run 5: Enter starting letter: t Enter step: -3 Resulting substring is: tqnkheb (
Expert Answer:
Answer rating: 100% (QA)
Python import string alphabet stringasciilowercase Input for the star... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
What is the net electric charge of this object? Note for advanced students: you can assume charge is measured in any convenient units, e.g. coulombs or units of e. Write down only the number part of...
-
After graduating from college in May 2018, Ryan Crews started his career in finance at the W&T Corporation, a small- to medium-sized warehouse distributor in Nashville, Tennessee. The company was...
-
What was removed from the rock exposure of Fig. 10.3 during abrasion by the overriding ice?
-
Find ||F|| and sketch several representative vectors in the vector field. F(x, y, z) = i + j + k
-
A \(1.5 \mathrm{~V}\) battery moves \(2000 \mathrm{C}\) of charge around a circuit. By how much does the chemical energy of the battery decrease?
-
1. Describe Gores global organizational design challenge? 2. What should Gore do to build effective global teams? 3. How will Gores culture affect the virtual global teams? 4. What is Gores strategy...
-
Mary was recently awarded $10,000 for winning a quilting contest. She deposited her winnings into an account paying 2% simple interest. At the end of 5 months, what will the account be worth?
-
Fore Farms reported a pretax operating loss of $137 million for financial reporting purposes in 2021. Contributing to the loss were (a) a penalty of $5 million assessed by the Environmental...
-
Derive the Boolean function in a SOP form and in a POS form from the following truth table A 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 B 0 0 0 0 1 1 1 C 0 0 1 1 0 0 1 1 0 0 0 0 0 1 0 1 1 0 1 0 1 1 0 1 1 1 D F...
-
On Oct. 13, 2021, Strong donated a property located in Nueva Ecija and cash as follows: Land with a FMV of P6.8M to a legitimate daughter on account of marriage, subject to a mortgage of P800,000 to...
-
a. Assume that your company has bonds with a market rate of return of 10% and equity with a required rate of return of 12%. Why does the debt have a lower required rate of return than the equity? b....
-
CCC Corporation Is an S corporation with two shareholders: Tim (70%) and James (30%). At the beginning of the year, Tim's basis of stock was $1,200. During the year, the corporation reported...
-
George Senior purchased a Claude Monet painting to hang in his head office at the price of $150,000. He held it for 5 years, and then sold it for $650,000. What should this asset be considered as?
-
1) A firm sells two different products, A and B. For each unit of B sold, the firm sells two units of A. Total fixed costs$1,260,000. Additional selling prices and cost information for both products...
-
Consider model (9.18). What is the effect on the model parameter estimates, their standard errors, and the goodness-of-fit statistics when (a) The times at risk are doubled, but the numbers of deaths...
-
First, complete TRY THIS Exercise 2. Then, if necessary, create a new project named TryThis9 Project, and save it in the Cpp8\Chap04 folder. Enter the C++ instructions from TRY THIS Exercise 2 into a...
-
Create a program that allows the user to enter the ages (in years) of five people. The program should display the average age. Use the for statement. Display the average age with one decimal place....
-
Write the code to store the number 100 in each element in the balances array from Pencil and Paper Exercise 1. Use two for statements.
-
The trustee calculated Millers current monthly income to be \($6,601.91.\) The disagreement stemmed from a paycheck Miller received on October 10, 2013, in the amount of \($2,942.66,\) for wages that...
-
In July 2006, the International Brotherhood of Teamsters, Local Union 25, filed two petitions and held an election for a collective bargaining representative at two FedEx locations. However, FedEx...
-
Longfellow Ranch in Pecos County, Texas. While Amerimex would usually provide mobile bunkhouses for its crews on site, the present contract required them to locate the bunkhouses 30 miles north in...
Study smarter with the SolutionInn App