Question
write a BASIC PYTHON program USING STRINGS for QUESTION 1. display in Fahrenheit a temperature provided in Celsius by the user. However, if the user
write a BASIC PYTHON program USING STRINGS for
QUESTION 1. display in Fahrenheit a temperature provided in Celsius by the user. However, if the user enters something that cannot be used, display the message - Bad Input - instead. Note that temperature input as a decimal, e.g., 50.5, should be acceptable.
QUESTION 2. It is common practice to prepare raw text for subsequent analysis in text analytics. Write a program that accepts some text (could be a paragraph) as input and prepares it by a) making it all one case and b) removing all punctuation marks (except the space) commonly found in text. (See your keyboard as a reminder of potential punctuation and make reasonable assumptions about which are commonly used in general text. See if you can write the code in a way that is not tedious or repetitive to write.) The program should also accept a word (or rather just a word fragment or string of characters, i.e., not necessarily a complete word) to be searched as a user input and then display a) how many times that fragment appears in the processed (i.e., cleanedup) text that was input as well as b) the starting location (numerical position) of the first instance of the fragment, if it is in the processed text. Here is a sample of a paragraph that could be used for testing (from https://patternbasedwriting.com/elementary_writing_success/paragraph-examples/): It was July 21, 1969, and Neil Armstrong awoke with a start. It was the day he would become the first human being to ever walk on the moon. The journey had begun several days earlier, when on July 16th, the Apollo 11 launched from Earth headed into outer space. On board with Neil Armstrong were Michael Collins and Buzz Aldrin. The crew landed on the moon in the Sea of Tranquility a day before the actual walk. Upon Neil's first step onto the moon's surface, he declared, "That's one small step for man, one giant leap for mankind." It sure was!
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