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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started