Python Question
eni-codes
PART 1
For each function, describe what it actually does when called with a string argument. If it does not correctly check for lowercase letters, give an example argument that produces incorrect results, and describe why the result is incorrect.
# 1
def any_lowercase1(s):
for c in s:
if c.islower():
return True
else:
return False
# 2
def any_lowercase2(s):
for c in s:
if 'c'.islower():
return 'True'
else:
return 'False'
# 3
def any_lowercase3(s):
for c in s:
flag = c.islower()
return flag
# 4
def any_lowercase4(s):
flag = False
for c in s:
flag = flag or c.islower()
return flag
# 5
def any_lowercase5(s):
for c in s:
if not c.islower():
return False
return True
PART 2
Give at least three examples that show different features of string slices. Describe the feature illustrated by each example. Invent your own examples. Do not copy them for the textbook or any other source
- 3 years ago
- 7
Purchase the answer to view it
- PYTHONQUESTION.docx
- Politics on Film Analysis 3
- feasibility study for Harley-Davidson
- PAD 505 WEEK 10 DISCUSSION (FOUR DIFFERENT VERSION ANSWER POSTED)
- Please read "The Childfree Life." please craft a one page reflection essay about the articles.
- Business Policy & Strategy 6
- Web-based Systems. The grocery store, Wow Munchies, is considering developing an online store for customers to purchase food. Review the mini case from Chapter 8 for more background information that may help you complete this assignment. The owner of
- .
- as discussed
- 4 simple questions involving financial calculations and 200 words
- Informational Argument