Skip to main content
Ask a Question
R.M.Maharshi
Data Science and Machine Learning
Asked a question 9 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