Related questions
Concept explainers
1. Write a function called removePunct() that takes a string and remove the
punctuations from that string (return a string without punctuation). Test your
function by getting some input from the user, print it, then pass it to the
removePunct() and then print the string with no punctuation.
Note: You are not allowed to use the built-in function and methods of python (like
remove)
This is a sample run of the program:
Please enter a string: Hello,m , , world!
This is the input: Hello,m , , world!
This is after removing puncts: Hellom world
2. Write a function that takes a number and translate it to English. For example the
translation of 2 is "two", the translation of 29 is "twenty nine", the translation of 291
is "two hundred ninety one".
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images
- In Python: Read a string as input from user and print the number of Uppercase alphabets present in the string in output.arrow_forwardIN PYTHON: Given a string representing a 10-digit phone number, output the area code, prefix, and line number using the format (800) 555-1212. Ex: If the input is: 8005551212 the output is: (800) 555-1212 Hint: Use string slicing operators. 18005551212 is not allowed.arrow_forwardI have a string with a phrase in it, and I want to turn it into all caps using the function toupper. Write a code fragment that does that and then prints the resulting string.arrow_forward
- for python programming make a program, that has a function that takes in a string argument and prints a sentence indicating the shortest word in that string. If there is more than one word print only the first. Your print statement should read: "The shortest word is x" Where x = the shortest word. The word should be all uppercase.arrow_forwardUsing import sys : Create a python program, palindrome.py, that has a function that takes one stringargument and prints a sentence indicating if the text is a palindrome. Thefunction should consider only the alphanumeric characters in the string, and notdepend on capitalization, punctuation, or whitespace.If your string is a palindrome it should print:It's a palindrome!If it is not a palindrome, it should print:It's not a palindrome!arrow_forward
- Text book imageDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationText book imageStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONText book imageDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- Text book imageC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONText book imageDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningText book imageProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education