Day 4 of #30DaysOfCode : String Functions

Day 4 of #30DaysOfCode : String Functions

Question:

In the GitHub repository, Infinity-AI(Infinite Learn and Grow)/30-days-code inside the Day-4 folder create name.py file as defined in the readme.md file.

  • Concatenate the string 'Thirty', 'Days', 'Of', Code to a single string, 'Thirty Days Of Code'.

  • Use capitalize(), title(), swapcase() methods to format the value of the string Ai For All.

  • "Facebook, Google, Microsoft, Apple, IBM, Oracle, Amazon" split the string at the comma.

Solution:

First of all, we assign these four strings to four variables and then we combine all these four strings and save them into a variable and print it.

Now we use some methods on the string 'Ai For All.' We assign this string to a variable so that we can easily perform all operations on the string.

Now we use the split method to split the string by comma.

Thank you :)=)