Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

##CODE IN PYTHON Exercise 6 In this exercise you will develop a small module consisting of four helping functions. All the functions have a unique

##CODE IN PYTHON

image text in transcribed

Exercise 6 In this exercise you will develop a small module consisting of four helping functions. All the functions have a unique argument word, and they return True or False. The functions are: - haslower(word): 'returns true if the word has lower case letters' - hasUpper(word): 'returns true if the word has upper case letters' - hasDigit(word): 'returns true if the word has digits' - hasSpecial(word): 'returns true if the word has special characters' The functions are self explanatory, the only missing information is that special characters in this exercises are considered to be : " !@\#\$\%^\&*( )_+" Define global constants for lower case, upper case, digits and special characters and write the code of these four functions. These functions are useful in checking passwords for example. You can test that they are correctly working by trying the below assert statements: assert hasLower("SuperP@55word")==True assert hasUpper( "SuperP@55word")==True assert hasDigit("SuperP@55word")==True assert hasSpecial("SuperP@55word")==True assert hasLower( "SUPERP@55WORD")==False assert hasUpper ("superp@55word")==False assert hasDigit("SuperP@ssword")==False assert hasSpecial ("SuperPa55word") =F False

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions