Westonci.ca connects you with experts who provide insightful answers to your questions. Join us today and start learning! Join our Q&A platform and get accurate answers to all your questions from professionals across multiple disciplines. Join our Q&A platform to connect with experts dedicated to providing accurate answers to your questions in various fields.

Given the string “supercalifragilisticexpialidocious”.
1. What is the length of the string i.e. write the script to find the length? (2 points)
2. Find the sub-string of first 5 positions and the other sub-string with last 5 positions. (4 points)
3. Find how many times “i” occurs in this word in python


Sagot :

The string and the three instructions is an illustration of the python strings

The length of the string

The following instruction calculates the length of the string using the Python script:

len("supercalifragilisticexpialidocious")

The returned value of the above instruction is: 34

The substrings

The following instruction calculates the sub-string of first 5 positions and the other sub-string with last 5 positions

myStr[:5]+myStr[-5:]

The returned string of the above instruction is: "supercious"

The number of occurrence of i

The following instruction calculates the occurrences of i in the string

"supercalifragilisticexpialidocious".count("i")

The returned value of the above instruction is: 7

Read more about python strings at:

https://brainly.com/question/13795586

Your visit means a lot to us. Don't hesitate to return for more reliable answers to any questions you may have. We hope you found what you were looking for. Feel free to revisit us for more answers and updated information. Discover more at Westonci.ca. Return for the latest expert answers and updates on various topics.