Skip to main content
Ask a Question
Data Science and Machine Learning
Asked a question 11 months ago

Write a Python's user defined function that removes all the additional characters from the string and converts it finally to lower case using built-in lower(). eg: If the string is "Dr. Darshan Ingle @AI-ML Trainer", then the output be "drdarshaningleaimltrainer". I tried to create a function like this. but it is not correct.. how do we define all these operations in a single function? def string_modification(x): x.isalnum() x.strip() x.lower() string_modification("Dr. Darshan Ingle @AI-ML Trainer") print(x)

Fuel your ambition, discover your passion and achieve your professional goals with LetsUpgrade.
Sign Up Now