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
VARVARA [1.3K]
3 years ago
6

Write a function named enterNewPassword. This function takes no parameters. It prompts the user to enter a password until the en

tered password has between 8 and 15 characters, including at least one digit. Tell the user whenever a password fails one or both of these tests. The function enterNewPasswordshould return the new password.
Computers and Technology
1 answer:
zloy xaker [14]3 years ago
4 0

Answer:

def enterNewPassword():

 while True:

   password = input("Enter password: ")

   has_digit = False

   for i in password:

     if i.isdigit():

       has_digit = True

       break

   

   if not has_digit or (len(password) < 8 or len(password) > 15):

     if len(password) < 8 or len(password) > 15:

       print("The password length must be between 8 and 15!")

     if not has_digit:

       print("The password must include at least one digit!")

   else:

     return password

print(enterNewPassword())

Explanation:

*The code is in Python.

Create a function named enterNewPassword that takes no parameter

Create an indefinite while loop. Inside the loop, ask the user to enter the password. Initialize the has_digit as False, this will be used to check if password contains a digit or not. Create a for loop, that that iterates through the password, if one character is digit, set the has_digit as True and stop the loop (Use isdigit() to check if the character is digit or not).

After the for loop, check if has_digit is false or the length of the password is not between 8 and 15. If the length of the password is not between 8 and 15, print the error. If has_digit is false, again print the error.

Otherwise, password met the requirements and return the password

Call the enterNewPassword() function and print the result

You might be interested in
Is technology a legal discipline or law is a technological artifact.
ANEK [815]

Answer:Technology law scholars have recently started to consider the theories of affordance and technological mediation, imported from the fields of psychology, human-computer interaction (HCI), and science and technology studies (STS). These theories have been used both as a means of explaining how the law has developed, and more recently in attempts to cast the law per se as an affordance. This exploratory paper summarises the two theories, before considering these applications from a critical perspective, noting certain deficiencies with respect to potential normative application and definitional clarity, respectively. It then posits that in applying them in the legal context we should seek to retain the relational user-artefact structure around which they were originally conceived, with the law cast as the user of the artefact, from which it seeks certain features or outcomes. This approach is effective for three reasons. Firstly, it acknowledges the power imbalance between law and architecture, where the former is manifestly subject to the decisions, made by designers, which mediate and transform the substance of the legal norms they instantiate in technological artefacts. Secondly, from an analytical perspective, it can help avoid some of the conceptual and definitional problems evident in the nascent legal literature on affordance. Lastly, approaching designers on their own terms can foster better critical evaluation of their activities during the design process, potentially leading to more effective ‘compliance by design’ where the course of the law’s mediation by technological artefacts can be better anticipated and guided by legislators, regulators, and legal practitioners.

Keywords

Affordance, technological mediation, postphenomenology, legal theory, compliance by design, legal design

7 0
3 years ago
In which area of the screen can features and functions of Word be accessed?
abruzzese [7]

Answer:

Toolbar

Explanation:

j don't know if you meant that instead of scroll bar, but tool bar is the answer

5 0
3 years ago
PLZ HELP ME! <br> Write pseudocode for getting a bowl of ice cream using at least four steps.
inessss [21]
1. Get the material that you need
2. Open the ice cream
3. Scoop out the ice cream using your materials
4. Put that scoop in a bowl
4 0
3 years ago
Margaret would like to work in the Journalism and Broadcasting industry. Which set of qualifications would best assist Margaret
8_murik_8 [283]
Critical thinking, accuracy and confidence
7 0
4 years ago
Read 2 more answers
What is the decimal form of the following binary ip address? 11001101.00111001.10101001.01000010
jasenka [17]

The decimal form of the 11001101.00111001.10101001.01000010 binary ip address is 205.57.169.66.

An IP address is a binary number with 32 bits. The 32 bits are divided into four octets, which are groupings of 8 bits each. An IP address, however, is shown as a dotted decimal number (for example: 205.57. 32.9).

Memory regions are given binary addresses by the computer system. But in order to access a memory location, the system utilises a certain number of bits. We can address two memory regions with 1 bit. We can address 4 memory locations with 2 bits and 8 memory locations with 3 bits.

The 4 sets of 8 bits in each of the 4 directions are simply written down to create the 32-bit binary IP address.

Learn more about binary ip address:

brainly.com/question/14541891

#SPJ4

3 0
2 years ago
Other questions:
  • Ideally, how often should you back up the data on your computer? once an hour once a day once a month once a year
    14·2 answers
  • What is the square root of 1600 and 36 ?​
    6·1 answer
  • The first idea for a communications network was called
    14·2 answers
  • "What technology will examine the current state of a network device before allowing it can to connect to the network and force a
    6·1 answer
  • question i need a real answer cuase i have a virus cuase off my borther and these are the notifacations i get and now these site
    11·1 answer
  • Your company just installed a new web server within your DMZ. You have been asked to open up the port for secure web browsing on
    5·1 answer
  • Write a C++ function for the following:
    14·1 answer
  • Select the correct answer from each drop-down menu. A company is recruiting for a web designer. What kind of candidate should th
    14·2 answers
  • Part of the operating system core is responsible for controlling security, managing the file system, and providing a platform fo
    6·1 answer
  • in the future, mobile technologies are expected to be used more than desktop computers today. what other improvements are helpin
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!