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
marysya [2.9K]
4 years ago
10

The contains_acronym function checks the text for the presence of 2 or more characters or digits surrounded by parentheses, with

at least the first character in uppercase (if it's a letter), returning True if the condition is met, or False otherwise. For example, "Instant messaging (IM) is a set of communication technologies used for text-based communication" should return True since (IM) satisfies the match conditions." Fill in the regular expression in this function:
Computers and Technology
1 answer:
STALIN [3.7K]4 years ago
7 0

Answer:

Following are the code to this question:

import re#import package regular expression

def contains_acronym(val): #defining a method contains_acronymn that accepts text value in parameter

   match= r"\([A-Z1-9][a-zA-Z1-9]*\)"#defining match variable that uses upper case, number, and lower case value  

   r= re.search(match, val)#defining r varaible that uses search method to search values

   return r!= None #use return keyword  

val="Instant messaging (IM) is a set of communication technologies used for text-based communication"

print(contains_acronym(val))#use print function to call method and print its return value

Output:

True

Explanation:

In the above-given code, first, we import package "regular expression" this package is used to check the string, In the next line, a method "contains_acronym" is defined that accepts a "val" variable in its parameters.

  • Inside the method, the "match" variable is defined that holds the uses upper case, number, and lower case values, and in the r variable the "search" method is defined, that search these and return the value.
  • Outside the method, val variable is defined, that store string value and use print method is used that calls the method "contains_acronym".      
You might be interested in
Why should the government create money it doesn’t have?
murzikaleks [220]

Answer:

to increase economy of the country

Explanation:

if the government does so the people will be able to access the money this increasing government revenue. This increasing the economy

8 0
3 years ago
Read 2 more answers
Extend the class linkedListType by adding the following operations: Write a function that returns the info of the kth element of
WINSTONCH [101]

Answer:

Explanation:

The following code is written in Java. Both functions traverse the linkedlist, until it reaches the desired index and either returns that value or deletes it. If no value is found the function terminates.

public int GetNth(int index)

       {

       Node current = head;

       int count = 0;

       while (current != null)

       {

       if (count == index)

       return current.data;

       count++;

       current = current.next;

       }

       assert (false);

       return 0;

       }

public int removeNth(int index)

       {

       Node current = head;

       int count = 0;

       while (current != null)

       {

       if (count == index)

       return current.remove;

       count++;

       current = current.next;

       }

       assert (false);

       return 0;

       }

6 0
3 years ago
A loop decision point for an algorithm consists of three features: an initial value, a set of actions to be performed, and a(n)
pychu [463]

Answer:

Option c is the correct answer for the above question.

Explanation:

A loop is used to repeat some lines in some specific times which depends on some conditions of the loop. If a person wants to print "welcome" on 5 times then he can do this by two ways one is writing a print statement 5 times and the other is states a loop that executes 5 times through condition. The loop is described or written by three necessary points which are:-

  1. The fist is to initialize the initial value which tells the compiler for the starting point of the loop.
  2. The second is to any action for that condition variable which takes the loop for the direction of ending points.
  3. The third is a condition that defines the ending point of the loop.

The above question also states about the loop in which first and second points are given then the third point is necessary to complete the sentence which is states in option c. Hence the option c is correct while the other is not because--

  • Option 'a' states about the class operator which is not the part of the loop.
  • Option b states about the documentation plan which is also not the part of the loop.

5 0
4 years ago
In distributed dos attacks, the attacker sends messages directly to ________. bots the intended victim of the dos attack backdoo
kirill115 [55]
The word DoS refers to the Disk Operating System. In the case given above, if it happens that there is a distributed DoS attack, the attacker then sends messages directly to the BOTS. Bots refer to internet or web robots. Hope this answer helps. The answer is the first option.
4 0
4 years ago
Which of these is an example of open-source software?
AysviL [449]

Answer:

C

Explanation:

8 0
4 years ago
Read 2 more answers
Other questions:
  • Allison needs to graph the yearly average snowfall in Alaska. She should use a:
    13·2 answers
  • You work as a network technician for uCertify Inc. You have erased data saved in your laptop. You still have many device configu
    6·1 answer
  • Two different names that refer to the same data item best defines:
    12·1 answer
  • True or False. Students taking courses log into Blackboard with their "key account" username and password.
    8·1 answer
  • Start with the following Python code. alphabet = "abcdefghijklmnopqrstuvwxyz" test_dups = ["zzz","dog","bookkeeper","subdermatog
    13·1 answer
  • When two conductors are accidentally connected it is<br> called a
    6·1 answer
  • Which of these communication avenues is not regulated by the Federal Communications Commission (FCC)?
    12·1 answer
  • Please answer<br><br>NO LINKS​
    7·1 answer
  • A local bank has just one branch. It sets up a peer-to-peer network for all devices on the system. The bank would like to be abl
    12·1 answer
  • A typical day in programming and software development would involve
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!