subject

This assignment is based on Exercise 8.4 from your textbook. Each of the following Python functions is supposed to check whether its argument has any lowercase letters. 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

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 25.06.2019 12:30
In many applications, only a small percentage of the points in a given set p of n points are extreme. in such a case, the convex hull of p has less than n vertices. this can actually make our algorithm convexhull run faster than θ(nlogn). assume, for instance, that the expected number of extreme points in a random sample of p of size r is o(rα ), for some constant α < 1. (this is true when the set p has been created by picking points uniformly at random in a ball.) prove that under this condition, the running time of the algorithm is o(n).
Answers: 3
question
Computers and Technology, 25.06.2019 15:30
If a 120 v appliance requires 15 a to operate, what is the resistance of the appliance?
Answers: 1
question
Computers and Technology, 25.06.2019 23:00
When viewing a document with hyperlinks in word, which key can be held on the keyboard in order to let the user click and visit the linked page or document when the cursor is on the hyperlink? escape control tab page up
Answers: 1
question
Computers and Technology, 26.06.2019 19:30
Select the correct answer from each drop-down menu. maria buys around 90 books of six different genres for her library and stores the purchase data in a spreadsheet. she wants to categorize the books under each genre and highlight the books under the fiction genre. which spreadsheet feature should she use to categorize and highlight records? she should use the to group the books under each genre and the to highlight the books under the fiction genre. for each space pick one of the following: subtotal nested if conditional formatting
Answers: 1
You know the right answer?
This assignment is based on Exercise 8.4 from your textbook. Each of the following Python functions...
Questions
question
English, 09.08.2021 14:00
question
Computers and Technology, 09.08.2021 14:00
question
Mathematics, 09.08.2021 14:00
question
Mathematics, 09.08.2021 14:00
question
English, 09.08.2021 14:00
question
Health, 09.08.2021 14:00
Questions on the website: 13722367