At Westonci.ca, we connect you with experts who provide detailed answers to your most pressing questions. Start exploring now! Ask your questions and receive detailed answers from professionals with extensive experience in various fields. 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