Question: 4. Using the 4 string variables shown, apply the following string methods and operators; show the result of each one. str1 = Simple is better

4. Using the 4 string variables shown, apply the following string methods and operators; show the result of each one.

str1 = Simple is better than complex

str2 = Readability counts

str3 = Explicit is better than implicit.

str4 = If the implementation is hard to explain, it's a bad idea.

str1.count(e) ___________________

str4.find(e) ___________________

str3.startswith(e) ___________________

str2.replace(t, +) ___________________

str1[10:16].islower() ___________________

str3[12:17].upper() ___________________

str3.islanum() ___________________

i in str3 ___________________

a not in str3 ___________________

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!