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

Answers

Answer 1

Explanation:

#1 is wrong because if the first character is not lowercase, it stops and returns false, ignoring all the other characters. It can be fixed by removing the else: statement and moving the return False statement outside of the loop.

This is efficient; if one lowercase character is encountered, the function 'knows enough' and can return true. Only if no lowercase is encountered it has to loop all the way to the end.

You can try this out on repl.it.

Many of the others functions have problems in them. #4 looks OK.


Related Questions

What are the importance of Help and Support feature of Windows​

Answers

Answer:

Explanation:

Start Menu Returns. It's what Windows 8 detractors have been clamoring for, and Microsoft has finally brought back the Start Menu. ...

Cortana on Desktop. Being lazy just got a lot easier. ...

Xbox App. ...

Project Spartan Browser. ...

Improved Multitasking. ...

Universal Apps. ...

Office Apps Get Touch Support. ...

Continuum.

1. What is the difference between operating systems and application software? (1 point)

Answers

The main difference between operating system and application software is that an operating system is a system software that works as the interface between the user and the hardware while the application software is a program that performs a specific task. This software assists the tasks of the system

1) You are working with an organization as a network manager. The organization has

two offices in Abu Dhabi. Each office is equipped with 25 computers. The

management wants the smooth flow of information between both the offices and

does not want any delay.

a. Management has asked you to connect the computers in both the offices with

each other. What type of network will you suggest to them and what can be

some possible benefits of using that network?

b. The management wants that in the Head Office, there can be no access to data

from outside. Which type of network will be your preference to implement in

that case and what will be the benefit of that?

Answers

Answer:

Explanation:

a. In this specific scenario, the best option would most likely be a site-to-site VPN. This would allow each office to be independently connected to the internet and at the same time be connected to each other securely and efficiently. There should be unnoticeable or no delay at all between the two offices and sensitive files will be completely secure. Therefore, the two offices can easily transfer data securely between one another without fear of the data being intercepted.

b.  The same VPN network would work on the head office, but instead we can implement firewall restrictions to the head office network itself. These restrictions would prevent any or all incoming connections that are trying to request data from the local head office network. This would allow the head office to continue working without worry of unwanted intruders in their network.

Describe a way that you can envision using the power of the computer through


distributed computing to enhance the quality of your life.

Answers

Answer:

Explanation:

In a way, we can use cryptocurrency as an example. Most cryptocurrencies use distributed computing in a form of decentralization to create an economy/system of information where individuals can transfer money. This ultimately gives back power to the people and puts individual's money back in their own hands. Therefore, getting rid of the banks entirely. This is an enormous enhancement in quality of life and is only one of the many innovations that cryptocurrencies have created.

A way that you can envision using the power of the computer through distributed computing to enhance the quality of your life is through content creating/making.

What is content creation?

Content creation is known to be the act or method of finding out/ identifying a novel topic you want to write about and then deciding which way you want the content to take.

Here, one has to create different strategy in producing content.  Through content making, one can use the power of the computer via distributed computing to enhance the quality of your life.

Learn more about  content creating from

https://brainly.com/question/13171394

1. This are tools used to make any presentation interesting and exciting.
a. audio and video
c. hyperlinks
b. animations
d. text and graphics​

Answers

Answer:

c. hyperlinks

Explanation:

The correct option is - c.hyperlinks

Reason -

The "hyperlink" function in PowerPoint allows users to advance from one slide to another slide in the presentation when they click on a predetermined word, shape, or image, thereby allowing for a more dynamic and interactive experience than can be obtained with serial presentation of slides alone.

1

The tire pressure is 20% underinflated.

The service life is reduced by...

%

check

Answers

Answer

A constant 20 percent underinflated condition will reduce the life of a tire by 30 percent, and 40 percent underinflation will reduce tire life by 50 percent. Underinflation will increase flexing and heat buildup within the tire components which deteriorate tires and reduces casing life and retreadability.

what is out put following code?​

Answers

Answer:

please provide full picture of the code and then i will be able to help u

Explanation:

Answer:

Do you have the entire question?

Explanation:

a worksheet can have a maximum of number of rows​

Answers

1,048,567 rows


I don’t really understand the question

Although you're limited to 255 sheets in a new workbook, Excel doesn't limit how many worksheets you can add after you've created a workbook. The only factor that ultimately limits the number of worksheets your workbook can hold is your computer's memory.

A Range is a group of selected Cells in an Excel worksheet. A Range can be rectangular or square in shape. You can select a Range by left-click, drag and release the mouse over the cells you want to select. ... Similarly, a Range in Excel worksheet is identified by a Range Address.
I believe it’s 1,048,567

what do you understand by local technology?

Answers

Answer:

It's basically people that assist to their activities in a daily life

Explanation:

Answer:

People that assist with each daily activities

Explanation:


What is the difference between iterative and sequential?

Answers

Answer:

iterative means to iterate, or "repeat" ex: 4,4,4,4,4

sequential means to increase with a constant ex:

1,3,5,7,9,11,13. the constant that the terms are incremented by is 2

Please its argent and I will give you BRAINLIEST ANSWER 6. How would you confirm that a colourless liquid given to you is pure water?

Answers

Answer:

Evaporate the colourless liquid on a low flame. If no residue is left and boiling exactly at 100 ºC then it is pure water otherwise not.

Explanation:

write a loop that finds the sum of the numbers between 7 and 34

Answers

THIS IS FOR PYTHON

total = 0

for i in range(7, 35):

   total += i

   print(i)

print(total)

I forgot the reason but python always stops one number before your desired value. So that's why it's 35

The loop that finds the sum of the numbers between 7 and 34 i2 as follows:

x = 0

for i in range(7, 35):

   x += i

print(x)

   

The code is written in python.

The variable x is initialise with the value zero.

For loop is used to loop through the range of value 7 to 35, excluding 35.

The looped values are then added to the variable x

The final sum is then printed out using the print statements in python.

learn more on loop: https://brainly.com/question/21897044?referrer=searchResults

Which of the following represents a bit?

0

01010110

3F02C

12.356

Answers

Answer:

0

Explanation:

A bit is a single piece of information and the smallest unit that can possibly represented by a computer, like 1 or 0.

The one that represents a bit is 0. The correct option is A.

What is a binary digit?

A binary digit (bit) is the smallest unit of binary data that can be stored in a computer system.

A bit can only be in one of two states: on or off, which are frequently represented by ones and zeros. Which information is entered into and processed by the computer is determined by the combination of ones and zeros.

One of the four types of number systems is a binary number system. Binary numbers are basically represented in computer applications by merely two symbols or digits, namely 0 (zero) and 1 (one).

A bit is a binary digit, which is the smallest data increment on a computer. A bit can only hold one of two values: 0 or 1, which correspond to the electrical values off or on.

Thus, the correct option is A.

For more details regarding binary number, visit:

https://brainly.com/question/28222245

#SPJ2

Assume there is an interactive math tutor. Many students take the math lessons online. At the end of each lesson, students have to attempt a test. What is the performance measure of this agent?

A.
count the number of students
B.
display suggestions for solving problems
C.
take input from the keyboard
D.
enable the student to attain maximum marks

Answers

Answer:

I think it is D

Explanation:

This is the goal, or the requirement for success.

Answer:

D. Enable the student to attain maximum marks

Explanation:

Correct on Clever

A test's directions often clarify any questions a student might have about answering a response question.

Please select the best answer from the choices provided

True
False

Answers

True, hope you have Have a good day
I’m good at technology and I say True.

you are teaching a class about basic camera functions like power, basic date/time, menu navigation, and how to properly attach and remove lenses from a DSLR or hybrid camera. While you would likely do a lot more showing than telling while teaching, share a script of what you would say to properly explain how to perform these basic actions.

Answers

Answer: So, I would start the class off with this, “Camera’s are so crucial to life, why because they capture light and memories that are a once and a lifetime thing.” Then after the students dwelling on that statement, I would start with talking about how to set up a camera. I would pull out mine and pull up a diagram on the green screen and show them step by step what I do. First, you want to turn the camera on by turning the switch where the white line lines up with “on”, once you are, then you want to set up the time and date. To do so, you want to click on the menu button, once you are in, there should be a list of five options, you want to go to the setup menu. Once there you want to click on “World time” there you can change the date and time.  Once you have set up the time you want to go back to the menu screen, there are 5 options. The five options are called “playback menu”, “Shooting menu”, “Custom Setting menu”, “Setup menu” and “retouch menu”. These five have various purposes in which we will get to later on inside of the lesson. Now camera lenses are super easy, when you are changing or taking off lens, there should be a button on the left side of the camera right under your camera model name. Hold that button in with one hand and grab the lens with the other, then you want to twist the lens till it comes off. To put it back on you want to line up the white dots and it should slide in and then twist it back on.  

Explanation: That is the answer

It should be noted that a camera simply means an optical instrument that's used to capture images or to record moving images.

A camera simply consists of a lens that focuses light from the scene. In a camera, the viewfinder is vital in viewing and framing the subject.

The flash is vital in producing light. The camera lens is important to shift between focal lengths. The shutter button is used to capture it record images.

Learn more about camera on:

https://brainly.com/question/609508

Consider the following code segment

Answers

Answer:

E

Explanation:

The first loop assigns "John" to name and prints name

The second loop iteratively prints every name in order in the given array.

A set of programs that enable the hardware to process data is _____.

a. network

b. procedures

c. software

d. hardware E. database

Answers

I think C but I'm not sure

What would you do if you experienced academic frustrations in school? Check all that apply.
Look for ways to do better academically in school.
Ask a friend to explain difficult concepts.
Try to identify the reason you are feeling frustrated.
Ask a teacher for help coming up with a solution.
Search online for help solving this problem.

Answers

I think it is all of them :))

Answer: all are correct

Explanation:

i say all because those are all really good ways to help you in school. if you are struggling then ask a to a teacher for help you, if you need more help, ask a friend. see what you can do to help yourself do better. see what you are doing that could possibly be the reason of your frustrations. and the internet is always open to questions and answers. but it also depends, some schools are strict about using the internet for answers. but if your school is different then use the internet freely. i hope this helped.

What is Internet Service Provider ? ​

Answers

Answer:

A company that provides subscribers with access to the internet.

Explanation:

Answer:

A company that supplies wifi service to access, use or participate in the internet.

Explanation:

Some examples would be Comcast, Verizon, Time Warner or ISP.


Avi does not want to save his internet browsing details on his computer. What should he do?
Avi should (copy,delete,or save) all the(virus,cookies,or logs) from his system after he has finished browsing.

Answers

He should delete logs.

Where do you click to add keywords to describe your image?

File>File Info and click on Basic
Edit>File Info and click on Basic
File>Preferences and select keywords
Right click on file and select Get Info

Answers

Answer:

D. I use a Mac and I right-click the file, then add tags. I can create new tags for describing a png image (or pdf if it was exported).

The place where click to add keywords to describe your image is right click on file and select Get Info. Thus, option D is correct.

What is HTML?

In technical terms, the HTML element happens to the collectible of a start tag, an end tag, attributes of the tag and everything that comes in between the start tag and the end tag. And whereas the HTML tag happens to be the opening or the closing, that is used for marking the beginning of the end of an element.

The first version of the page's HTML, together with any JavaScript that may be present in the HTML file. HTML for the webpage that displays DOM changes. HTML lacks intelligence on its own since it is incapable of doing mathematical operations, determining whether a form has been completed correctly, or making judgments based on how a website visitor interacts with it.

Therefore, The place where click to add keywords to describe your image is right click on file and select Get Info. Thus, option D is correct.

Learn more about HTML on:

https://brainly.com/question/24065854

#SPJ6

choices.
1. To check the integrity of your hard disk and fix various file system errors, which
Windows utility should be implemented?
A. Back up B. Check disk C. Defragmentation D. Disk Clean up
2. An event or action took place and it caused damage to data, hardware, software
and processing capability of the computer. From the statement given, which of the
following is being described?
A. logic programs
C. security process
B. security access
D. security risks
3. This software program infect, damage and disrupts the whole computer system.
Which of the following is being described?
A. Malware B. Trojan horse C. Virus D. Worms
4. To protect the whole computer system, which software utility is needed?
A. Anti-virus B. Check disk C. Defragmentation
D. Disk clean up
5. To avoid losing valuable data to your computer, which is the most important thing
A. always save files on the desktop
B. regularly back-up your files
C. always used permanent storage devices in saving files
D. regularly save your files into temporary devices​

Answers

Answer:

1. B

2. D

3. C

4. A

5. B

Explanation:

1. To check the integrity of your hard disk and fix various file system errors, the Windows utility which should be implemented is Check disk (Chkdsk). This utility is always used with the command line interface (CLI) with the command "chkdsk."

2. An event or action took place and it caused damage to data, hardware, software and processing capability of the computer. From the statement given, security risks are being described. Any event or action that is capable of causing a problem to a computer system is considered to be a security risk and should be prevented through the use of an appropriate utility software.

3. Virus is a software program that can infect, damage and disrupts the whole computer system.

4. To protect the whole computer system, the software utility which is needed is an Anti-virus.

5. To avoid losing valuable data to your computer, the most important thing to do is to regularly back-up your files.

If Gabrielle's message contained information that is only intended for the recipient, the message should be marked to discourage it from being shared?
private
normal
sensitive
delayed​

Answers

Private.

From the lack of information in the question, it can be assumed that the message arrived in a timely fashion.

As it is not said that the message is urgent, it is not sensitive to a reply.

Finally, there is a caveat to the message in that it is only intended for he recipient, therefore it is not a normal message.

This leaves one answer and one only: Private.

help plz ;-;

which of the following terms means "storing a value in a variable"?

assignment
operator
variable
exponent​

Answers

Answer:

Assignment

Explanation:

Storing a value in a variable (memory location) is called assignment.

In programming, Assignment serves as storing a value in a variable.

variable serves as a container for a value. For instance, when performing addition, the number there is a variable

A variable is been considered with space in the computer's memory and this can help in holding a value.

Therefore, option A is correct.

Learn more at:https://brainly.com/question/23275071

a python program for the following output using for loop.

Output:


-13

-7

-1

Answers

Answer:

In Python

for i in range(-13,0,6):

   print(i)

Explanation:

Required: A program to display the given output

From the program, we observe the following:

The output begins at 13 i.e begin = 13

The output ends at -1 i.e end = 1

And the difference between each output is 6.

i.e. [tex]-1 - (-7) = -7 - (-13) = 6[/tex]

So, the syntax of the for loop is: (begin, end + 1, difference)

The program explanation goes thus:

This iterates through the -13 to 1 with a difference of 6

for i in range(-13,0,6):

This prints the required output

   print(i)

Which basic design principle is primarily made up of lines?​

Answers

Answer:

Shape

Explanation:

Marissa is designing a web page that features lessons on how to build cabinets. how can she make the page most engaging for the user?

A. by adding warm colors to make the content more fun to view.

B. by adding a short video demonstrating how to build cabinets.

C. by adding a variety of font types to make the text look appealing.

D. by adding a slideshow that displays pictures of built cabinets.​

Answers

I am pretty sure it’s B because that’s the only answer that really correlates to teaching people how to build cabinets

l
What do we call a statement that displays the result of computations on the screen?
ОА.
result statement
ов.
screen statement
OC output statement
OD
answer statement
OE.
input statement

Answers

Answer:

Output statement. The others do not make sense.

What are the steps for inserting an internal link?
1. Type into a cell.
2. Then, select the that includes the cell you wish to link to.
3. Next, click the cell you wish to reference.
4. Finally, press .

Answers

Answer:

=

Worksheet

Ctrl + Enter

Explanation:

Answer:

=, worksheet, Ctrl+Enter

Explanation:

Other Questions
An atom of nitrogen contains seven electrons. Describe the number ofelectrons in each energy level in an atom of nitrogen. Someone please help me asap!!! I need serious answers please explain! I will give brainliest!! The chart shows the low temperature each day in International Falls, Minnesota, during the month of February 2009. What was the median low temperature in International Falls for the first week of the month? 6 -9 -29 -31 -8 4 3anwsers a -9 b -9 c -8 d -31 A light-year is a way to measure ______ in space.O timeOdistance PLS HELPPPPPPPPPPPPPPPPPPPPPPPPPLLLLLPL Elle and Layla are collecting data on student use of the school library. They collect data samples from the same population of students. After collecting their data, they each determine the standard deviation for their data sets. Layla's standard deviation is much larger than the standard deviation from Elle's data set. Dividef)(4b+13b + 21) (b+8) When preparing to create a soccer team at your school, your principal asks you who should be in charge of running thisteam. Which form of government would you use as a model for creating your team? Which of the following is a good inventory storage practice?O A.first in, first outOB. first in, last outOC. last in, first outOD.last in, last out During the mid-1800s, the Indian Territory was reduced as:O A. white settlers claimed the land for farming.O B. the changing climate made it less suitable for farming.C. tribes moved to reservations in order to avoid white settlers.D. Americans and the Spanish fought over the land. describe one disadvantage of a capitalist system Please help me! I'll give brainiest again! What is the overall message of raisin in the sun According to the authors, what is the duty of the government, who gives a government its powers, and, more importantly, what can be done if the government does not do its duty? Please I need help for spanish I WILL GIVE A LOT OF POINTSWrite a paragraph about a play that you have seen. If you prefer, you can make it up. Use vocabulary from the activity on plays. For example, you might tell how the usher helped you find your seat and gave you the program, how many acts and scenes there were, what the stage set looked like when the curtain rose, how the audience reacted, and so on. Write a total of ten sentences. Be creative! (answer needs to be in spanish, and their must be 10 sentences) When the distance between two objects doubles, what happens to the gravitational attraction between these two objects? if you calculating the simple interest and you are given the time in months. how can you find the time in years 7/8th grade math please help! Here is Priya's calculation of 906 divided by 3Priya wrote 320 for the value of 906 +3. Check her answer by multiplying it by 3. What product do you get and what does it tell you about Priya's answer?correct answer is 302** what value of d makes the equation true scrap metal buyer pays $3.18 Per square foot of steel. how much can you earn by selling the steel drum below? round your answer to the nearest dollar.