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
myrzilka [38]
3 years ago
6

write a function that takes a string as parameter, return true if it’s a valid variable name, false otherwise. You can use keywo

rd module’s iskeyword() to determine if a string is keyword.
Computers and Technology
1 answer:
never [62]3 years ago
8 0

Answer:

The solution code is written in Python 3:

  1. import keyword  
  2. def checkValidVariable(string):
  3.    if(not keyword.iskeyword(string)):
  4.        return True  
  5.    else:
  6.        return False  
  7. print(checkValidVariable("ABC"))
  8. print(checkValidVariable("assert"))

Explanation:

Firstly, we need to import keyword module so that we can use its iskeyword method to check if a string is registered as Python keyword (Line 1).

Next, we create a function checkValidVariable that takes one input string (Line 3). Within the function body, we use iskeyword method to check if the input string is keyword. Please note the "not" operator is used here. So, if iskeyword return True, the True value will be turned to False by the "not" operator or vice versa (Line 4-5).

We test the function by passing two input string (Line 9-10) and we shall get the sample output as follows:

True

False

You might be interested in
after turning the volume all the way up on the speakers, you still cannot hear any sound. which of the following should be your
brilliants [131]
No options shown, but typically the next step is checking the connection to see if its plugged in.

Always use the 7 layers of the OSI model to solve technology problems, starting at Hardware and ending at the Applications level.

6 0
4 years ago
What e-mail protocol does Marina and Rita’s Cupcakes use and why is it important?
Taya2010 [7]

Marina and Rita’s Cupcakes use the IMAP email protocol. It is important since it stores copies of all the emails stored on the server.

 

To add, IMAP<span> (Internet Message Access Protocol) is a standard email protocol that stores email messages on a mail server, but allows the end user to view and manipulate the messages,</span>

8 0
4 years ago
There are a number of classifications that can be applied to security controls.
kodGreya [7K]

Answer:

Preventive control is not a classification that can be applied to security controls.

Explanation:

At the most basic level, we should protect resources and assets that are of value to an organization by mitigating the risk to those assets and resources. Security controls include any type of policy, technique, procedure, or solution that help mitigate risks. There are models that define security control objectives and are classified by control type and by function

By Control Type

  1. Physical control: Anything that can be touched and can be used to detect and prevent unauthorized access from adversaries and threat actors. Examples include CCTV, electric fences, Biometrics
  2. Technical controls: Examples include firewalls, AMSI solutions, IDSs and IPSs that help protect an organization’s resources and assets. They can be both hardware and software solutions.
  3. Administrative controls: These are the overall design of the protocols or guidelines that define business needs based upon the organization’s security goals that help implement a secure environment. Things like staff awareness and training are among the examples of administrative controls.

Learn more about Security Control classification

brainly.com/question/13239384

brainly.com/question/14409331

#LearnWithBrainly

5 0
4 years ago
Which Boolean operator enables you to exclude a search term?
Lisa [10]

It is letter D. but i might be incorrect, please contact your teacher for further information. sorry if I got your answer wrong... :(

4 0
3 years ago
Read 2 more answers
"When using BitLocker on a laptop, the laptop should not use standby mode, rather it should use hibernate mode. This is because
Harman [31]

Answer:

This statement is false.

Explanation:

The correct statement should read:

"When using BitLocker on a laptop, the laptop should not use standby mode, rather it should use hibernate mode. This is because Hibernate writes memory to the computer’s disk drive, ****which means the contents of the computer's memory are protected by Bitlocker.****

Standby mode (which is basically putting the computer to sleep) keeps the computer in a very low power state, and memory is maintained and not protected by BitLocker."

Hope this Helps.

6 0
4 years ago
Other questions:
  • Hope has now created her sublist. 1. Oxygen a. Helps living things produce energy b. Helps protect living things from harmful ra
    15·1 answer
  • What are the advantages of renting a home over buying a home? What are some disadvantages?
    13·1 answer
  • If I want to have an estimate of the number of people who visited my website, which metric should I use?
    5·2 answers
  • Identify the output, input, and any missing information for the following problem. George wants to find out how much extra he wi
    15·1 answer
  • Which ieee 802.11 standard provides for throughput of up to 7 gbps?
    8·1 answer
  • This function causes a program to terminate, regardless of which function or control mechanism is executing.
    12·1 answer
  • is there anybody out there who is a social butterfly like me? If so then you can tlk to me on this. and to anybody out there tha
    12·1 answer
  • Meaning of sperm count
    5·2 answers
  • Answer this pls ASAP
    11·1 answer
  • PLEASE ANSWER! I NEED IN 30 MIN.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!