Write a Python simple program, to ask the user input a string, and display only the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a Python simple program, to ask the user input a string, and display only the first quarter (one fourth) and the last quarter substrings of the input string. The program should be written in ""A2Q1A.py". Requirements: 1. Ask user a string, and assign it to a variable astr 2. Extract the first quarter substring of the input string to a variable fStr, with slicing technique 3. Extract the last quarter substring of the input string to a variable estr, with slicing technique 4. Join two extracted substrings above, and display the result as sample output below 5. Assume the number of characters in the string is divisible by 4. Sample program output: Enter a string: 12345678 Joined string is 1278 Write a Python simple program, to ask the user input a string, and display only the first quarter (one fourth) and the last quarter substrings of the input string. The program should be written in ""A2Q1A.py". Requirements: 1. Ask user a string, and assign it to a variable astr 2. Extract the first quarter substring of the input string to a variable fStr, with slicing technique 3. Extract the last quarter substring of the input string to a variable estr, with slicing technique 4. Join two extracted substrings above, and display the result as sample output below 5. Assume the number of characters in the string is divisible by 4. Sample program output: Enter a string: 12345678 Joined string is 1278
Expert Answer:
Answer rating: 100% (QA)
Python program that fulfills your requirements A2Q1Apy Ask user for ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
9. Determine the next three terms of the sequence. Explain your reasoning. (4 marks) a. 1 2 3 4 2'5'8'11 b. 1, -8, 27, -64, 125......... 10. A population of rabbits if left unchecked will triple...
-
Write a while loop with a sentinel value This while loop ends when the user enters a 1, the sentinel value Assign the number 8 to a variable which will serve as the sentinel value Condition: while...
-
Explain how an increase in government expenditure will change the governments budget balance and the loanable funds market. The International Monetary Fund (IMF) reported that it acted effectively in...
-
Figure 9.1 is a generalized longitudinal profile of a river, with elevations above sea level plotted against distance from the mouth of the river. What does it show?
-
In about 100 words, summarize the advantages and disadvantages of using a mall-style commerce service provider such as eBay Stores or Amazon.coms Pro Merchant program instead of operating a...
-
An electronics hobbyist is building a radio set to receive the \(\mathrm{AM}\) band, with frequencies from \(520 \mathrm{kHz}\) to \(1700 \mathrm{kHz}\). The antenna, which also serves as the...
-
At the end of Donaldson Department Stores fiscal year on November 30, 2017, these accounts appeared in its adjusted trial balance. Freight-In . $ 7,500 Inventory . 40,000 Purchases . 585,000 Purchase...
-
Stanley Company has 18,000 outstanding shares of $25 par, 6.25% preferred stock, and 22,000 shares of $3 par value common stock. The Board of Directors declared and paid the following dividends:...
-
For each scenario below, identify which sampling method was used. Explain your reasoning. a) A dean decided to assess students' views on the school cafeteria's food. To do so, the dean randomly...
-
Calculate the financial ratios of the following: Current ratio Times interest earned Inventory turnover Total asset turnover Operating profit margin Operating return on assets Debt ratio Average...
-
What difference does it make to the poem's meaning that "Umpaowastewin" by Margaret Noodin is also in Anishinaabemowin? What does it have to do with making jam? Explain
-
The fastest man-made object is the parker solar probe, itsmaximum speed record is 430,000 mph. It the probe maintained thatspeed for a year (it wont), how much time does it lose compared toan...
-
5 The Evan ec Company's D = 2.62 } its (an be sold to net $28 next expected dividend growth rate is 7% and its Common stock now sells for 35 New stock per share of retained a) what is Evanec's cost...
-
A corporation purchases several new 5- and 7-year class personal property items throughout the current year. If the corporation wishes to take the maximum Code Sec. 179 deduction for the current...
-
Suppose Garageband.com has a 28% cost of equity capital and a 10% cost of debt capital. The firm's debt-to-equity ratio is 1.5. Garageband is interested in investing in a telecomm project that will...
-
The following balance sheet accounts of a foreign subsidiary at December 31, 2020, have been translated into U.S. dollars as follows: Translated at Current Rates Historical Rates Accounts receivable...
-
Find the volume of the described solid S. A frustum of a right circular cone with height h, lower base radius R, and top radius r -r- --R
-
Fill in the blanks in each of the following statements: a) One-dimensional array p contains four elements. The names of those elements are _______, _______, _______and _______. b) Naming an arrays...
-
State whether each of the statements that follows is true or false. If false, explain why. a) Its possible to treat base-class objects and derived-class objects similarly. b) All methods in an...
-
Translator programs, such as assemblers and compilers, convert programs from one language (referred to as the source language) to another language (referred to as the target language). Determine...
-
Discuss the implications of Hadprets inflation forecast on the expected returns of the funds holdings of: i. cash. ii. bonds. iii. equities. iv. real estate. Discuss the implications of Hadprets...
-
Working individually or in groups, answer the question, Is there such a thing as an accident-prone person?
-
Discuss how interest rate and exchange rate linkages between Eastland and Northland might change under each scenario. Discuss how interest rate and exchange rate linkages between Eastland and...
Study smarter with the SolutionInn App