1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Svetlanka [38]
3 years ago
12

Some Web sites impose certain rules for passwords. Write a function that checkswhether a string is a valid password. Suppose the

password rules are as follows:A password must have at least eight characters.A password must consist of only letters and digits.A password must contain at least two digits.Write a program that prompts the user to enter a password and displays validpassword if the rules are followed or invalid password otherwise.
Computers and Technology
1 answer:
Levart [38]3 years ago
6 0

Answer:

def check_password(pwd):

   c=0

   d=0

   for i in pwd:

       if (i>='a' and i<='z') or (i>='A' and i<='Z'):

           c+=1

       elif i>='0' and i<='9':

           d+=1

           c+=1

   if len(pwd)==c and d>=2 and len(pwd)>=8:

       print("valid password")

   else:

       print("Invalid password")

 

ps=input("Enter password for checking : ")

check_password(ps)

Explanation:

  • Loop through the password and check if it contains any alphabet.
  • Increment the counter if it contains any alphabet.
  • If it contains a number, increment both c and d variables.
  • Finally display the relevant message.
You might be interested in
In which career field, would the Computing Technology Industry Association's CompTIA A+ certification be useful?
Anna [14]
It's geared towards system administration but would also be useful for devops.
5 0
4 years ago
Alan is developing a business impact assessment for his organization. He is working with business units to determine the maximum
jekas [21]

Answer:

A. Recovery time objective (RTO)

Explanation:

The recovery time is defined as the maximum length of time require to recover a system or any network from the failure.

Hence, to determine the recovery time of the function, one can use the RTO.

7 0
3 years ago
The current calendar, called the Gregorian calendar, was introduced in 1582. Every year divisible by four was declared to be a l
Naily [24]

Solution :

Public Function Is a Leap_Year(Year As_Integer) As Integer

'Dim Tor_F for local variable declaring if value is t/f.

Dim TorF As For Boolean

'Pre conditions: Year > 1581 and Year < 3000

If Year > 1581 And Year <> 1700 Or 1800 Or 1900 Then

IsLeapYear = Year / 4

Else

IsLeapYear = False

TorF = False

End If

End Function

8 0
3 years ago
After merging two arrays is complete you need to
VikaD [51]

Answer: C) copy the merged array back to the original array

Explanation:

 After performing merging of two array then, copy the merge array back to its original array. Merging of two array is done by the process of merge sort. Merging of two array is the similar process of concatenate the two array into the single object.

It basically works on the principle of divide and conquer algorithm. It divide the input value into the two half and then, sorted the accordingly. Then after completion of merging the two array it copy into the original array.

5 0
3 years ago
Choose all the answers that apply.
maxonik [38]
They form on the surface and cool more quickly having larger mineral crystals. just learned this aha
7 0
3 years ago
Other questions:
  • What is computer virus?
    8·1 answer
  • 100 students were asked to fill out a form with three survey questions, as follows: H: Honor Roll C: Club membership (Robotics C
    7·1 answer
  • In a doubly linked list, every nodecontains the address of the next node and the previousnode except for the ____ node.
    8·1 answer
  • No processo fluido a fluido há outra câmara na saída do material extrudado com pressão menor que a câmara anterior. Isso permite
    8·1 answer
  • Which feature of a website takes you to a different part of the website or a totally different website when you click on it?
    12·2 answers
  • How do you change the color on the text in the email​
    6·1 answer
  • • Suppose an application generates chunks of 40 bytes of data every 20 msec, and each chunk gets encapsulated in a TCP segment a
    5·1 answer
  • A woman puts on a business suit. Which post-WWII fashion does her clothing typify?
    12·2 answers
  • To calculate perimeter of a rectangle​
    9·2 answers
  • Why can a CPU retrieve and process bits of data quickly?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!