Q5. The output of the following code is 'tiangong@tiangong.edu.cn'. import re pattern = '[a-zlt ? [a-z]*@tiangong.edu.cn' test string = 'tiangong@tiangong.edu.cn' print (re.findall (pattern, test string))
Q: KOTLIN we had a string remove all whitespace | from that
A: Please find the answer below :
Q: python: def dna_slice(strand, first_nucleotides, last_nucleotides): """ Question 3 - Regex…
A: Please refer to the following steps for the complete solution to the problem above.
Q: The coding language is python The code in there may or not be correct I was playing around with it…
A: PROGRAM: # The user in prompted for input and stored in userInput userInput = str(input("Enter the…
Q: 1. Write a function called `CleanString` that takes one argument, an accounting number formatted as…
A: In step 2, I have provided solution for Q1----------In step 3, I have provided solution for…
Q: Write the function selection_sort_descend_trace() that takes an integer list and sorts the list into…
A: Code of the given program-
Q: ef loopy_madness(string1: str, string2: str) -> str: """ Given two strings and , return a…
A: According to the Question below the Solution: Output:
Q: Find the output of the following ? a=[12 3;4 5 6;7 8 9], b-[9 8 7;6 5 4;3 2 1],c=[2 4 6;8 3 5;1 7 9]
A: Program Plan: Declare the matrix a, b, and c. Display the product of a' b' and c'.
Q: How do I implement a function that calculates the score for a single word using the following code:…
A: Solution: Implementation of test_get_word_score(): def test_get_word_score(): """ Unit…
Q: In python, The function remove_vowels takes one parameter, s, a string of any length. The function…
A: The Python code is given below with code and output screenshot Happy to help you ?
Q: python: def character_dict(prof_dict): """ Question 2 - Given a dictionary that maps a character to…
A: Python provides an integrated development learning environment to develop and execute a python…
Q: Write the code for the following function. """ def unmask_chars(s1: str, s2: str, mask: str) ->…
A: Step-1: StartStep-2: Function unmask_chars(s1, s2, mask) Step-2.1: Declare variable newStr…
Q: There may have bugs from line 1 to 10. Please find bugs and change it or remove if the line has to…
A: Explanation: 1. open() takes in two parameters, the first being the file to be opened, and the…
Q: (1) Prompt the user to enter a string of their choosing. Store the text in a string. Output the…
A: Since there are multiple subparts, the first three subparts are answered for you. If you want the…
Q: Part 2. f. Create a new StringBuilder Object using no-arg constructor. g. Using for loop append the…
A: Create a java file - Performance.java and copy the code to the file. You have to run the program 3…
Q: You had a set of string and your task is to convert it to array and print the array without using…
A: Requirements:- You had a set of string and your task is to convert it to array and print the array…
Q: #include const int TABLE SIZE = 17; class HashMap { private: HashEntry *table; HashMap() { public: }…
A: The algorithm of code 1:- 1. Declare a class HashEntry to store the key-value pairs.2. Declare a…
Q: Integer k is read from input. Then, eight strings are read from input and stored in the list…
A: The objective of the question is to write a Python program that reads an integer and eight strings…
Q: Suppose you are given a function in module foo named `function loop_string_reverse_all that accepts…
A: I have provided PYTHON CODE along with CODE SCREENSHOT and OUTPUT SCREENSHOT
Q: Earite a java program to read from a file called "treeList.txt". The file includes tree height, and…
A: import java.util.*;import java.io.*;public class Main{ public static void…
Q: You are given a variable named zipcode_list that has been defined and refers to a list of postal c…
A: Given: Code in Python
Q: Please help to program these
A: Approach In a method named sameEnds(), we have used for loop and if-else construct. The statement…
Q: given input word, return the list of abbreviations. ex) word => ['word', 'wor1', 'wo1d', 'wo2',…
A: The complete code is given below with output screenshotHere's a step-by-step algorithm for…
Q: in C++ Write a program that accepts a string of text ENTERED BY THE USER. Program must accept any…
A: Huffman Coding Algorithm:1. Create a frequency table for characters in the given input text.2.…
Q: In main(), call WriteHeader(); Declare an array of 6 integers named numbers. Declare variables for…
A: The objective of the question is to create a program that will ask the user to input 6 integers,…
Q: given input word, return the list of abbreviations. ex) word => ['word', 'wor1', 'wo1d', 'wo2',…
A: Start.Define a function called generate_abbreviations that takes an word as input and returns a list…
Q: Write Code to Split Even and Odd Numbers in Separate List using this list : [22,8,7,0,13,99,38,63])…
A: Step-1: Start Step-2: Create a list Num with values [22, 8, 7, 0, 13, 99, 38, 63] Step-3: Declare…
Q: PrintCountryNames function work. It should print the list of countries
A: In PrintCountryNames() function to print list of country names, you need to make the following…
Q: Write a function that uses regular expressions to extract SIN numbers with either dashes or spaces…
A: Please find the answer below :
Q: 1. You may use the source code template in h3.s found in the assignment zip archive as a starting…
A: Here is the c++ code: See below steps for code.
Q: Answer the following questions in a file called bigo.java: ● Write an O(n) algorithm that…
A: Here have to determine about sequentially inserts an element into a list in java.
Q: The original sentences are uppercase letters, lowercase letters Java program to restore the original…
A: We have to compress the string using a program and then # character shouldn't appear in restored…
Q: def thing2(lst: List[int]) -> None: """TODO: Enter your description of the runtime complexity of…
A: Time Complexity - Time complexity is used to measure computer time taken by algorithm/program, Ou…
Q: def while_loops(string1: str, string2: str) -> str: """ Given two strings and , return a new…
A: Write a python program that will merge two strings using "interwoven" method and provide following…
Q: Which of the below is a correct initializer list for an array of strings? Select one: a. String[]…
A: A String is a sequence of characters. Arrays are used to store multiple values of the same types in…
Q: Does it matter what order the operands are typed in when using EXCEPT (MINUS) to do a search?
A: In SQL, the EXCEPT operator returns all the different rows that are not repeated from the initial…
Q: create a javascript function that oddlyEven( data ) This function accepts a single input. The first…
A: Algorithm Steps:- Define objects to be used as maps to look up the mapping from digits to codings…
Q: What is the output of this code? (scroll to the left and right to make sure you have viewed the…
A: The program is written in Java. Check the program screenshot for the correct indentation. Please…
Q: String replacement is read from input. Then, sentence is read from input. If replacement is in…
A: The objective of the question is to perform certain operations on a string based on the user input.…
Q: indexes_for_zeroes = [] for i in range(len(features[-1])): last_col = features[-1] if…
A: The error occurs because the code is trying to access an index that does not exist in the features…
Q: } /** * Adds letterGuessed to the current String updateLetterBoard * @param usedLetterBoard * @param…
A: Solution: 1. Implementation of public static String updateLetterBoard(String usedLetterBoard, char…
Q: In the code get_grade_stats(scores) scores refers to its O argument O arguments O parameter
A: Function parameter & argument: Function parameters and arguments are often applied for the same…
Q: putList [['April","Bill','Cindy','Dave'], ['123 Main St.', '456 Oak St.', '234 Oa…
A: inputList = [['April', 'Bill', 'Candy', 'Dave'], ['123 Main St.', '456 Oak St.', '234 Oak St.', '78…
Q: given input word, return the list of abbreviations. ex) word => ['word', 'wor1', 'wo1d', 'wo2',…
A: def generate_abbreviations(word): def backtrack(result, word, pos, count, cur): if pos ==…
Step by step
Solved in 2 steps
- Q5. The output of the following code is 'tiangong@tiangong.edu.cn'. import re pattern = '[a-zt ? [a-z]*@tiangong.edu.cn' test string 'tiangong@tiangong.edu.cn' print (re.findall (pattern, test string)) =Can you help me fix thisWrite (i) declares a string (of size [5] 6. a program that str_a (LAST_FOUR_DIGITS_OF_YOUR_STUDENT_ID % 11 + 30)) and initializes with "Your own name, Your own student id". (ii) Take input from user into str_a. This string may have alphabets and digits. (iii) Store only the numerical characters of str_a into another string str_b. (iv) If the string str_b doesn't contain any numerical character, print 0 (zero), otherwise, print str_b. Some example input/outputs are given below: Example 1 Example 2 Example 3 Example 4 abc 123abc 12ab34 Input Output 123 123 123 1234
- The top three most popular male names of 2017 are Oliver, Declan, and Henry, according to babynames.com. Write a program that modifies the male_names set by removing a name and adding a different name. Sample output with inputs: 'Oliver' 'Atlas' { 'Atlas', 'Declan', 'Henry' } NOTE: Because sets are unordered, the order in which the names in male_names appear may differ from above. Code writing challenge activity demo 461710.3116374.qx3zqy7 1 male_names 2 name_to_remove = input() 3 name_to_add=input() 4 = 11 { 'Oliver', 'Declan', 'Henry' } 5 6 7 print (male_names) Your solution goes here '''Write a function get_total_price(class_list) that takes in a list of class callnumbers and outputs the total price of all textbooks in the class list. Use the catalog list ofdictionaries in the provided catalog.py file to look up a variety of information about abookstore catalog. Hint: To access the file from within your solution, you should add an import catalog call tothe top of your Python file.by calling catalog. catalog. this is the catalog file: csci = {"abbreviation":"CSCI", "department":"Computer Science","classes": [{"number": "1133", "textbook": "Programming in Python", "price":60.00},{"number": "3081W", "textbook": "UML Distilled", "price":45.00},{"number": "4041", "textbook": "Introduction to Algorithms", "price":70.00},{"number": "4511W", "textbook": "Artificial Intelligence", "price": 159.99},{"number": "5511", "textbook": "Artificial Intelligence", "price": 159.99}]} chen = {"abbreviation":"CHEN", "department":"Chemical Engineering","classes": [{"number": "3101",…msleep**** For this assignment, you must name your R file msleep.R (using Rstudio) For all questions you should load tidyverse. You should not need to use any other libraries. Load tidyverse with suppressPackageStartupMessages(library(tidyverse)) The actual data set is called msleep Round all float/dbl values to two decimal places. If your rounding does not work the way you expect, convert the tibble to a dataframe by using as.data.frame() All statistics should be run with variables in the order I state E.g., “Run a regression predicting mileage from mpg, make, and type” would be: lm(mileage ~ mpg + make + type...) Before attempting to answer these, or if you lose points upon an attempt, please review all CodeGrade information provided in the CodeGrade overview submodule - if you do not you are likely to lose points. What is the variance in total sleep for carni vores and those whose conservation status is lc? Your answer should be in a 1 X 1 data frame with a value…
- Using c++ Contact list: Binary Search A contact list is a place where you can store a specific contact with other associated information such as a phone number, email address, birthday, etc. Write a program that first takes as input an integer N that represents the number of word pairs in the list to follow. Word pairs consist of a name and a phone number (both strings). That list is followed by a name, and your program should output the phone number associated with that name. Define and call the following function. The return value of FindContact is the index of the contact with the provided contact name. If the name is not found, the function should return -1 This function should use binary search. Modify the algorithm to output the count of how many comparisons using == with the contactName were performed during the search, before it returns the index (or -1). int FindContact(ContactInfo contacts[], int size, string contactName) Ex: If the input is: 3 Frank 867-5309 Joe…In the following program skeleton, replace the < insert code here> line with theappropriate code. The resulting program should display the initial list of songs,prompt the user for a string of text to be replaced and then prompt for new text toreplace it. After making the replacement, it should display the updated list of songs.import java.util.Scanner;public class UpdateSongs{public static void main ( String [] args){Scanner stdIn = new Scanner(System.in);String songs =“ 1. Welcome to Your Life – Grouplove\n” +“ 2. Sedona – Houndmouth\n” +“3. Imagine – John Lennon\n” +“4. Bohemian Rhapsody –Queen\n”;String oldText, newText;< insert code here>}}Sample Session:1. Welcome to Your Life – Grouplove”2. Sedona – Houndmouth3. Imagine – John Lennon4. Bohemian Rhapsody –QueenEnter text to replace: LennonEnter new text: Dean1. Welcome to Your Life – Grouplove”2. Sedona – Houndmouth3. Imagine – John Dean4. Bohemian Rhapsody –QueenPYTHON Complete the function below, which takes two arguments: data: a list of tweets search_words: a list of search phrases The function should, for each tweet in data, check whether that tweet uses any of the words in the list search_words. If it does, we keep the tweet. If it does not, we ignore the tweet. data = ['ZOOM earnings for Q1 are up 5%', 'Subscriptions at ZOOM have risen to all-time highs, boosting sales', "Got a new Mazda, ZOOM ZOOM Y'ALL!", 'I hate getting up at 8am FOR A STUPID ZOOM MEETING', 'ZOOM execs hint at a decline in earnings following a capital expansion program'] Hint: Consider the example_function below. It takes a list of numbers in numbers and keeps only those that appear in search_numbers. def example_function(numbers, search_numbers): keep = [] for number in numbers: if number in search_numbers(): keep.append(number) return keep def search_words(data, search_words):