Your program should include the following four functions:
check_length - This function should accept a password to evaluate as a parameter and should return a score based on the length of the password. A password that is less than 8 characters long gets a length score of 1. If it is between 8 and 11 characters long (inclusive), it gets a length score of 2. A password that is 12 characters or longer gets a length score of 3.
check_case - This function should accept a password to evaluate and return a case score of 1 or 2. If the letters in the password are all uppercase or all lowercase, the case score should be a 1. If there is a mix of uppercase or lowercase letters (or if there are no letters at all), it gets a case score of 2.
check_content - This function should accept a password to evaluate and return a content score. If the characters are all alphabetic characters, the content score is 1. If the characters include any numeric digits (either all numeric or a mix of letters and digits), the content score is 2. If there are any other types of characters (such as punctuation symbols), the content score is 3.
main - This function represents the main program. It accepts no parameters and returns no value. It contains the loop that allows the user to process as many passwords as desired. It function calls the other functions as needed, computing the overall score by adding up the scores produced by each function. All output should be printed in the main function.
python please

Answers

Answer 1

Answer:

def main():

   pwd = input("Password: ")

   print("Length: "+str(check_length(pwd)))

   print("Case: "+str(check_case(pwd)))

   print("Content: "+str(check_content(pwd)))

   

def check_length(pwd):

   lent = len(pwd)

   if lent < 8:

       return 1

   elif lent >=8 and lent <= 11:

       return 2

   else:

       return 3

   

def check_case(pwd):

   if(pwd.isupper() or pwd.islower()):

       return 1

   else:

       return 2

   

def check_content(pwd):

   if(pwd.isalpha()):

       return 1

   elif(pwd.isalnum()):

       return 2

   else:

       return 3

   

if __name__ == "__main__":

   main()

Explanation:

The main begins here

def main():

This prompts the user for password

   pwd = input("Password: ")

This calls the check_length function

   print("Length: "+str(check_length(pwd)))

This calls the check_case function

   print("Case: "+str(check_case(pwd)))

This calls the check_content function

   print("Content: "+str(check_content(pwd)))

The check_length function begins here    

def check_length(pwd):

This calculates the length of the password

   lent = len(pwd)

If length is less than 8, it returns 1

   if lent < 8:

       return 1

If length is less than between 8 and 11 (inclusive), it returns 2

   elif lent >=8 and lent <= 11:

       return 2

If otherwise, it returns 3

   else:

       return 3

The check_case function begins here    

def check_case(pwd):

If password contains only uppercase or only lowercase, it returns 1

   if(pwd.isupper() or pwd.islower()):

       return 1

If otherwise, it returns 2

  else:

       return 2

The check_content function begins here

def check_content(pwd):

If password is only alphabet, it returns 1

   if(pwd.isalpha()):

       return 1

If password is only alphanumeric, it returns 2

   elif(pwd.isalnum()):

       return 2

If otherwise, it returns 3

   else:

       return 3

This calls the main function    

if __name__ == "__main__":

   main()


Related Questions

Write a SELECT statement that returns these four columns from the Products table: The list_price column A column that uses the FORMAT function to return the list_price column with 1 digit to the right of the decimal point A column that uses the CONVERT function to return the list_price column as an integer A column that uses the CAST function to return the list_price column as an integer Use column aliases for all columns that contain a function.

Answers

Answer:

See explanation below

Explanation:

SELECT list_price,

            FORMAT(list_price, 1) AS formatted_list_price,

            CONVERT(INT, list_price) AS converted_list_price,

            CAST (list_price AS INT) AS casted_list_price

 FROM products_table;

In SQL, the SELECT statement is used to initiate a query. It lists the variables that will be contained in the output, just like choosing items on a list, with each item being separated by a comma.

The FORMAT, CONVERT, CAST are all functions that are used to change the format of a value. Their formats are;

FORMAT - Format (value, decimal places)CONVERT - Convert (datatype, value)CAST -         Cast ( value AS datatype

In SQL, aliases are used to rename variables (usually those that contain functions) to ones taste. The AS is used after the function and the new name follows right after.

The IBM system/370 architecture uses a two-level memory structure and refers to the two levels as segments and pages, although the segmentation approach lacks many of the features described in Chapter 8. For the basic 370 architecture, the page size may be either 2 KB or 4 KB, and the segment size is fixed at either 64 KB or 1 MB. For the 370/XA and 370/ESA architectures, the page size is 4 KB and the segment size is 1 MB. What advantages of segmentation does this scheme lack

Answers

Answer:

Explanation:

Introductory thought:  

Thinking about the architecture for the IBM System/370 that is fit for giving higher preparing force and more stockpiling limit since it utilizes two-level of memory structure which is known as the segments and caches and the given plan is as per the following:  

In division the address space is isolated into quantities of segments of variable sizes and then again in paging the address space is partitioned into quantities of fixed-sized units that are known as pages.It is more helpful for better utilization of memory. The fundamental architecture for the IBM system/370 architecture the size of the page are for the most part either 2KiloBytes (KB) or 4KB and the size of the segments will be changed from 64KiloBytes to 1MegaBytes.   The two dissimilar kinds of architecture that existed are 370/XA that is the Extended Architecture, also the other is 370/ESA known as the Enterprise Systems Architecture.    The page size is 4KB for the Extended variant and 1MB for the Enterprise Systems Architecture (ESA).

Advantages of segmentation that the given scheme needs to incorporate includes:

In the configuration of the architecture for IBM System/370 the segments are of a fixed size which isn't noticeable for the programmer and as such he will know the interior subtleties and subsequently inside architecture is stowed away from outside gentle.  In IBM system/370 the reference bit is zero for the processor hardware as well as at whatever point another page is stacked into the edge, the reference bit is changed to one after referring to a specific area inside the casing.  The quantity of lines of the page outline table is overseen by the Operating System and a page outline table section is moved to start with one line then onto the next depending on the length of the span of the referenced bit from the page outline which is sets to nothing. Whenever there is a need to supplant the page then the page browsed the line of the longest life non referenced edges.

Implement a class named Rectangle. The class should contain:
1. Two data attributes of type float named width and height that specify the width and the height of the rectangle.
2. A constructor that creates a rectangle with the specified width and height. If no argument is provided, it should use 1.0 for both values. If any input value is negative, the function should raise an exception.
3. Functions get_width and get_height that return the corresponding value
4. The set_width and set_height function that update the values if and only if the input is positive; otherwise do nothing
5. Functions get_area and get_perimeter that return the area and the perimeter of this rectangle respectively.
6. A function rotate that swaps the height and width of a rectangle object.
7. A class variable count that keeps track of the number of rectangles created so far.
8. A class method get_count that returns the above value.
9. An equality operator that returns True if and only if the two rectangles are of the same shape.
10. A __str__ function that returns the information of this rectangle in some readable format.

Answers

Answer:

Explanation:

The following code is written in Python and creates a Rectangle class that performs all the necessary functions mentioned in the question...

from itertools import count

class Rectangle():

   _ids = count(0)

   width = 1.0

   height = 1.0

   def __init__(self, width, height):

       if (width < 0) or (height < 0):

           raise Exception("Sorry, no numbers below zero")

       else:

           self.id = next(self._ids)

           self.width = width

           self.height = height

   def get_width(self):

       return self.width

   def get_height(self):

       return self.height

   def set_width(self, width):

       if width > 0:

           self.width = width

   def set_height(self, height):

       if height > 0:

           self.height = height

   def get_area(self):

       return (self.height * self.width)

   def get_perimeter(self):

       return ((self.height * 2) + (self.width * 2))

   def rotate(self):

       temp = self.height

       self.height = self.width

       self.width = temp

   def get_count(self):

       return self._ids

   def equality(self, rectangle1, rectangle2):

       if rectangle1 == rectangle2:

           return True

       else:

           return False

   def __str__(self):

       return 'Rectangle Object with Height: ' + str(self.height) + ' and Width: ' + str(self.width)

Write a program named Twitter that accepts a user’s message and determines whether it is short enough for a social networking service that does not accept messages of more than 140 characters.

If the message is more than 140 characters, output The message is too long. Otherwise output The message is okay.

Answers

Explanation:

It's a very easy one, Liev:

using System;

class Twitter

{

static void Main()

{

Console.WriteLine("Enter your message");

Console.WriteLine();

string message = Console.ReadLine();

Console.WriteLine();

if (message.Length <= 140)

{

Console.WriteLine("Yes, it's short enough for Twitter");

}

else

{

Console.WriteLine("Sorry, it's too long for Twitter");

}

Console.ReadKey();

}

}

what is digital museum​

Answers

Access hundreds of professional development resources for museum professionals. Museum professionals can benefit at any career stage from student to retiree. Student Membership. Industry Membership. Established Since 1906. Museum Memebership. 501(c)3 Nonprofit Org.

Explanation:

1.Digital museum is a museum exhibition platform that utilizes computer and information technology, on which cultural relics and historical collections can be preserved and displayed in digital format. It is one of the main outcomes of digital curation. Learn more in: The Challenges of Digital Museum

A set of object that share a common structure and common behavior in database is called ​

Answers

An Object Class. Hopefully this answer is right.

What is the value of: 1 + int(3.5) / 2?
Select one:
a. 2
b. 2.25
C. 2.5
d. 3

Answers

Answer:

C (2.5)

Explanation:

int(3.5) = 3

So, using order of operations, (3/2)+1=2.5

The value of the expression value of: 1 + int(3.5) / 2 is known to be option C, which is (2.5).

What is the expression about?

In maths, an expression is known to be the composition of numbers, functions such as addition, etc.

Note that int(3.5) = 3

Therefore, using the given order of operations, (3/2)+1

=2.5

Therefore the answer =2.5 is correct.

Learn more about Expression  from

https://brainly.com/question/723406

#SPJ2

I like the impact that the increasing number of social grants may have on the things mothers​

Answers

Answer:

yes. i do too.

Explanation:

When did games begin to really take off?


A: when people began to live with formal laws

B: when people began to compete for limited resources

C: when people began to settle together in stable, organized communities

D: when people began to hunt nomadic animals, like buffalo

Answers

I think its b? or C? cause games didnt exist till the 90s mostly

giving Brianlist (to the correct answers)help plesee question is what is keyboard (long paragraph)​plzz don't spam with unnecessary answers !!!!thankyouuuuuuu:)

Answers

Answer:

Explanation:

A computer keyboard is an input device that allows a person to enter letters, numbers, and other symbols (these are called characters in a keyboard) into a computer. Using a keyboard to enter lots of data is called typing. A keyboard contains many mechanical switches or push-buttons called "keys".

How do I create a flowchart to output numbers from n...1? We were doing loops during the classes.

Answers

I use GOxxOGLE FORMS or WxxORDS and their good to make flow charts


Blocks that allows you to repeat scripts multiple times are

Answers

Answer:

here are several methods to make a script perform an action for a set amount of ... Technically, this may not work if you have wait blocks or other blocks that take up time. ... This script uses the timer and the Repeat Until block.

Explanation:

What are folders within folders called​

Answers

it is called a subfolder????

Answer:

The folder within folder are also know as subfolder .

What is
Computer Security

Answers

Answer:

Computer Security is the protection of computer systems and networks from information disclosure, theft of or damage to their hardware, software, or electronic data, as well as from the disruption or misdirection of the services they provide.

Explanation:

Answer:

the protection of computer systems and information from theft

Explanation:

What type of role does the group leader have? Informal negative positive Formal

Answers

Just as leaders have been long studied as a part of group communication research, so too have group member roles. Group roles are more dynamic than leadership roles in that a role can be formal or informal and played by more than one group member

how does abstraction help us write programs

Answers

Answer:

Abstraction refines concepts to their core values, stripping away ideas to the fundamentals of the abstract idea. It leaves the common details of an idea. Abstractions make it easier to understand code because it concentrates on core features/actions and not on the small details.

This is only to be used for studying purposes.

Hope it helps!

What are the 3 biggest advancements in computers?

Answers

Answer:

abacus . Mesopotamia or China, possibly several thousand years BCE. ...

binary math . Pingala, India, 3rd century BCE. ...

punched card . Basile Bouchon, France, 1725. ...

Explanation:

:)

As in previous prelabs, you can enter all the necessary Java code fragments into the DrJava Interactions pane. If you get an error, enter the corrected code. If you get really mixed up, you can reset the interactions pane and try again. Write a while loop that computes the sum of the first 10 positive integers. Write a for loop that computes the sum the first 10 positive integers. For each loop, you should use two variables. One that runs through the first 10 positive integers, and one that stores the result of the computation. To test your code, what is the sum of the first 10 positive integers

Answers

Answer:

public class Main{

public static void main(String[] args) {

 //The While Loop

 int i = 1;

 int sum = 0;

 while(i <=10){

     sum+=i;

     i++;  }

 System.out.println("Sum: "+sum);

 //The for Loop

 int summ = 0;

 for(int j = 1;j<=10;j++){

     summ+=j;  }

 System.out.println("Sum: "+summ); } }

Explanation:

The while loop begins here

 //The While Loop

This initializes the count variable i to 1

 int i = 1;

This initializes sum to 0

 int sum = 0;

This while iteration is repeated until the count variable i reaches 10

 while(i <=10){

This calculates the sum

     sum+=i;

This increments the count variable i by 1

     i++;  }

This prints the calculated sum

 System.out.println("Sum: "+sum);

The for loop begins here

 //The for Loop

This initializes sum to 0

 int summ = 0;

This iterates 1 through 10

 for(int j = 1;j<=10;j++){

This calculates the sum

     summ+=j;  }

This prints the calculated sum

 System.out.println("Sum: "+summ); }

A slide titled Alexander Graham Bell. There are 6 bulleted entries on the slide, and there is a lot of text on the slide. There is very little space around the text to the edges of the slide. There is no image on the slide and the text is shaded white on a blue background.
This slide has several design problems, according to the design principles that were just reviewed. What are the problems? Check all that apply.

The slide contains too much text.
The slide does not have an image or visual aid.
The text is too small.
The background makes it hard to read the text.
The slide does not have enough empty space.

Answers

Answer:

The following are design problems associated with the Alexander Graham Bell slide:

The slide contains too much text.

The slide does not have an image or visual aid.

The background makes it hard to read the text.

The slide does not have enough empty space.

Explanation:

Answer:

It's not ABDE, it's ABE

Explanation:

i tried it

what precautions should be taken to make a computer more secure ​

Answers

Answer:

To make a computer more secure

Explanation:

we have following ways :

1)we should have anti virus to protect our computer.

2)we should not play or look computer for a long time because it destroy our files

Which of the following terms is associated with instant messaging?
A. buddy list
B.subject heading
C.Save As
D.texting

Answers

D.

Texting is associated with instant messaging

Answer: A buddy list is a term that is associated with instant messaging (IM)

Have a wonderful day :D

Explanation:

an affective website design should fullfill its intended by conveying its message while simultaneosly engaging the visitors?do you agree or disagree​

Answers

Answer: True

Explanation:

The statement that "an effective website design ought to be able to fulfill the function that it has by passing the message across while engaging the visitor at the same time" is true.

Some of thr factors which bring about a good website design are functionality, simplicity, imagery, consistency, colours, typography. A website that's well designed and built will help in the building of trust.

You are creating a Web document on a mobile device and will be out of your Internet Service Provider's coverage range for the remainder of the day. Which HTML5 API will allow you to continue working on the document?
This task contains the radio buttons and checkboxes for options. The shortcut keys to perform this task are A to H and alt+1 to alt+9.
A

Canvas
B

Offline Web application
C

Drag-and-drop
D

Geolocation

Answers

a, canvas yuh yuh yuh

15 points....How do you get money at home by just playing a vidio game.

Answers

You could become a creator or make an account on twitch

Streaming or you tube!

I personally am starting to stream within the new few years but creating content and streaming can make you money by getting subs, bits, and more :)

what is falg register​

Answers

Answer:

I dont know the answer

Explanation:

I dont know the answer

If you meant “FLAGS register”, it’s the status register in Intel x86 microprocessors. It contains the current state of the processor.

Which three major objects are built into the JavaScript language?
This task contains the radio buttons and checkboxes for options. The shortcut keys to perform this task are A to H and alt+1 to alt+9.
A

Document, Object, Model.
B

Canvas, Geolocation and Drag.
C

None, JavaScript is object-based not object-oriented.
D

Document, Navigator, Array.

Answers

Answer:

jddjjddjdjdjjsjsjejejejjejejejjdjdjeje

Pretty sure, the answer is: None, JavaScript is object-based not object-oriented.

What is Typing?
And
What is Economic? ​

Answers

Answer:

what is typing: the action or skill of writing something by means a typewriter or computer

what is economic:a branch of knowledge concerned with production,consumption,and transfer of wealth.

The information in DNA Is coded in chemical bases adenosine (A) guanine (G) cytosine (C), and thymine (T) We can represent a DNA strand by stringing together the letters representing the appropriate strand. Imagine we are given a list of DNA strands which have arbitrary lengths. Write a single function strand_counter() which takes a list of DNA strands, counts the lengths of each of the words in the list and then calculates and returns the integer maximum_length integer minimum_length, and float average_length
Then write a program which takes in a user-chosen number of strands of arbitrary length as an input and prints out the calculated information
Example input
5
AT
ATCGTCOGGT
TCGCT
TCGATTCCT
TTCATCG
Example output
The longest strand has length 10.
The shortest strand has length 2.
The average length of the strands is 6.6.

Answers

Answer:

c

Explanation:

i think i leard it out my old shcool

true or false with reason :- carriage inword is carriage on purchases​

Answers

Answer:

True

Explanation:

Carriage on purchases is carriage inward. Explanation: Carriage inwards refers to the transportation costs required to be paid by the purchaser when it receives merchandise it ordered with terms FOB shipping point. Carriage inwards is also known as freight-in or transportation-in.

:)

Which term is defined by the total operating current of a circuit?

Answers

Answer:

OK PERO NOSE LM SOTTY BROTHER

Explanation:

Other Questions
What is the volume of a cube with a side length of 3t5units?Cube V = s3 Can somebody help me? Match each situation with the agency or act that would address it. 1. Akari has a sink that is shaped like a half-sphere. The sink has a volume of8000*n in. One day, her sink clogged. She has to use one of two3cylindrical cups to scoop the water out of the sink. The sink is completely full,when Akari begins scooping. Hint: you may need to find the volume for both.(a) Cup A has a diameter of 4 in, and a height of 8 in. Find the Volume of Cup A.(b) Determine how many cups of water must Akari scoop out of the sink with Cup A toempty it? Round the number of scoops to the nearest whole number, and makecertain to show your work.(c) Cup B has a diameter of 8 in, and a height of 8 in. Find the volume of Cup B.(d) How many cups of water must she scoop out of the sink with Cup B to empty it?Round the number of scoops to the nearest whole number, and make certain toshow your work Direct Democracy meaning Which object has the greatest inertia?1 lb of butter2 lb bag of sugar5 lb bag of apples10 lb bag of potatoes Oxygen and carbon dioxide that are recycled by the oxygen and carbon dioxide cycles are used in cellular respiration and photosynthesis. truefalse solve this equation for y, y=x-4 Pls help i need it now pls i will give 20points pls answer it correctly plsSolve the system y = -x + 7 and y = -0.5(x - 3)^2 + 8 please help!!!!!!!!!how does staphylococcus infection affect the integumentary system? 25X -5 =10 + 70x=6y + 14-8y=Helppp I have 3 more Minutess:( Explain how the spread of Christianity hurt the Roman Empire. Bert is planning to open a savings account that earns 1.6% simple interest. He wants to earn exactly $336 in interest after 3 years. How much money should he deposit Solve the equation 5.5(x-3)=17+10.5 in systems of equations. How can you find your solution? There are a total of 63 bikes at a sports shop. If 18 bikes are blue, what is the ratio of blue bikes to black bikes? why should we protect our school Please help! Question is in the picture. Statements Reasons Given: AWXY is isosceles with legs WX and WY: AWVZ is isosceles with legs WV and WZ. Prove: AWXY AWZ 1. given 1. WXY is isosceles with legs WX and WY 2. given 2. AWZ is isosceles with legs WV and WZ Z 3. WX EWY, WE WZ 3. def. of isosceles traingle W 4. def. of V 5. (WZ}(Wx) = (WY) (WZ) 5. multiplication property 6. (WZ)(WX) = (WYWY Complete the steps of the proof. WV 7. property of proportion 8. ZWE ZW 8. reflexive property 9. AWXY - AWZ What is 33/16 rounded to the nearest tenth? please help asap i didnt pay attention in class