1. Write a Python program that takes a string from user and removes all characters in...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Write a Python program that takes a string from user and removes all characters in that string except alphabets. Sample Input: "sfh79sgg!@6$pq" Sample Output: "sfhsggpq" *** The ASCII value of lowercase alphabets are from 97 to 122. And, the ASCII value of uppercase alphabets are from 65 to 90. If the ASCII value of the character entered by the user lies in the range from 97 to 122 or from 65 to 90, that number is an alphabet. *** use ord() function to get the ascii value of a character. Like, ord('b') = 98 1. Write a Python program that takes a string from user and removes all characters in that string except alphabets. Sample Input: "sfh79sgg!@6$pq" Sample Output: "sfhsggpq" *** The ASCII value of lowercase alphabets are from 97 to 122. And, the ASCII value of uppercase alphabets are from 65 to 90. If the ASCII value of the character entered by the user lies in the range from 97 to 122 or from 65 to 90, that number is an alphabet. *** use ord() function to get the ascii value of a character. Like, ord('b') = 98
Expert 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...
-
Write a Java program to encrypt and decrypt a phrase using two similar approaches, each insecure by modern standards.The first approach is called the Caesar Cipher, and is a simple "substitution...
-
Juanita Torres is 35-years old and lately has been working with her financial planner. She is attempting develop a long-term savings and investment program. She has been thinking about all the major...
-
Respond to the following independent situations: a. Jacob is a single taxpayer who has net investment income consisting of $10,000 interest on a certificate of deposit, $5,000 from dividends from a...
-
A U.S. investor is considering investing $100 million in Fiat stock in Italy. The stock has an expected return of 5% in euros, including the dividend yield, and the investor is forecasting a 3%...
-
Teller Crackers & Snacks (TCS) recently held a contest in which it awarded each of ten randomly drawn entrants a large box of assorted crackers each week for a year. The names and addresses of the...
-
Find the future values of these ordinary annuities. Compounding occurs once a year. a. $400 per year for 10 years at 10% b. $200 per year for 5 years at 5% c. $400 per year for 5 years at 0% d....
-
5. Convert the following E/R diagrams to a relational database using the straight-E/R method. (a) length title to Stars year genre Movies Voices isa isa Cartoons Murder- Mysteries weapon
-
The Blacks moved from Maine to Nevada. As a result, they sold their house in Maine on January 4, 2018. They originally paid $76,000 for the home on July 3, 1993, but managed to sell it for $604,000....
-
Your employer offers you a group retirement saving benefits of matching 20% of your monthly saving in the retirement account. Every month, you plan to save CAD 200. You expect to earn 6% return from...
-
Write me a problem statement about research topic the role of packaging design influencing consumer buying decision within fast food industry include, data statistic, theory, from micro perspective...
-
What does fresh start accounting mean? When it is utilized, how are a company's assets and its liabilities reported? Explain and support What do you know about statement of realization and...
-
After a company resolved an incident, the management wanted a report describing what happened to identify what changes would help mitigate future incidents. What kind of report can a company prepare...
-
Why is it important for a company to accurately budget and apply MOH? Explain.
-
What Custom reports are used when standard reports do not yield the level of detail needed?
-
A$100,000investment is made over a 10 -year period. A return of$23,000occurs at the end of the first year. Each successive year yields a return that is12%less than the previous year's return. If...
-
Show that, given a maximum flow in a network with m edges, a minimum cut of N can be computed in O(m) time.
-
Assume mystring references a string. Write a statement that uses a slicing expression and displays the first 3 characters in the string.
-
Assume the variable dct references a dictionary. Write an if statement that determines whether the key 'Jon' exists in the dictionary. If so, assign the value of 'Jon' to a key of 'John', and then...
-
Write a program that reads a string from the user containing a date in the form mm/dd/yyyy. It should print the date in the format March 12, 2018.
-
A thin stainless steel disk of thickness \(b\) and outer radius \(r_{o}\) has been heat treated to a high, uniform initial temperature of \(T_{i}\). The disk is then placed upon a small stand and...
-
A plane wall of a furnace is fabricated from plain carbon steel \(\left(k=60 \mathrm{~W} / \mathrm{m} \cdot \mathrm{K}, ho=7850 \mathrm{~kg} / \mathrm{m}^{3}, c=430 ight.\) \(\mathrm{J} / \mathrm{kg}...
-
A steel sphere (AISI 1010), \(100 \mathrm{~mm}\) in diameter, is coated with a dielectric material layer of thickness \(2 \mathrm{~mm}\) and thermal conductivity \(0.04 \mathrm{~W} / \mathrm{m} \cdot...
Study smarter with the SolutionInn App