Problem 3: Write a function that takes in a string as input and returns a list of the unique characters used in the string. Punctuation should not be counted as a unique character. For our purposes you may consider the following characters as punctuation:.,;:?!"'- Your list should return all letters as lower case and sorted. So for example if the input is ' Happy days are here again! 'your function should return the list ['a 'r' 'y']
Q: How to create a function str_asterisk() that takes a string of five words, and returns a list of…
A: 1) Since you have not specified the programming language I have written program in python 2) Below…
Q: In program problem6.py, write a function named longestCommonSuffix to find the longest common suffix…
A: #function to find and return the longest common suffix of list of numbersdef longestCommonSuffix(l):…
Q: In C++, Write a function that receives a string of characters and return true if the string is in…
A: A program is to be written in a C++ language. The program can be compiled on any one of the online…
Q: Let lst = '(1 2 3 4 5). The function check-1? returns #t only if the input list contains 1, the…
A: The answer has given below:
Q: In C language, Write a function that gets a string containing a positive integer. The function…
A: Step 1: Prompt and accept an integer value and store it as a string. Step 2: Convert it to long long…
Q: Write a function isln that accepts two strings as arguments and returns True if either string occurs…
A: Note: AS, per company guidelines we are supposed to answer only one question at a time (as both are…
Q: Write a function countNonAlnum() that takes a string as parameter, finds and returns the number of…
A: Python offers built in method isalnum() which returns true is string is alphabet or numeric
Q: 1- Write a function that takes a word less than 25 characters long and returns the letter that word…
A: #include <stdio.h> #include <string.h> #include <ctype.h> // returns the first…
Q: o Write a function called average(list) that takes a list as a parameter and returns the average.…
A: ALGORITHM:- 1. Declare and initialise the list with the elements. 2. Pass it to the average()…
Q: Problem 3 Write a program called p3.py. Write a function called validate() that takes a string as…
A: Here I have created the function validate(), which takes one input parameter. In this function, I…
Q: 9. You are a class teacher at a kindergarten school. As a task, you asked your students to write a…
A: 1) Below is program to read a string from user and capitalize the string and display It defines a…
Q: C++ : .Write a function that, given two strings, creates another string that contains only the…
A: Code: #include<iostream>using namespace std;#include <string>void func(string s1,string…
Q: Define a function named get_word_lengths_tuple (sentence) which takes a sentence as a parameter. The…
A: Below I have provided Python Programming. Also, I have attached the screenshot of the code and…
Q: please code in python Write a function that receives a string and a number (n) as parameters and…
A: To implement everyNth(), strings concept in python is used.
Q: Please use python for this problem: Please use Python when answering the question: Question…
A: Python is a high level programming language. Guido van Rossum, is the father of Python. Just like…
Q: b. Write a function that has 2 parameters, x and y, and returns a list of all of the numbers…
A: Here, you need to write python function which has 2 parameters. In this function, you need to find…
Q: In the space below, write a function Def countVowels(wordPhrase): that returns a…
A: Below is the implementation of the method countVowels(wordPhrase) that returns the count of vowels…
Q: Write a function that takes in a string as input and returns a list of the unique characters used in…
A: NOTE - I have used the Java programming language. Here I have created a function named…
Q: Write a function anagram that accepts two text strings and returns True if the strings are anagrams…
A: Write a function anagram that accepts two text strings and returns True if the strings are anagrams…
Q: Q5. Write a function called findString to determine if one character string exists inside another…
A: Solution:: Here is code: #include <stdio.h> #include <string.h> int match(char [],…
Q: Write a isPalindrome Function Write a function isPalindrome($str) that returns true if the parameter…
A:
Q: 5: CheckLetter.cpp) Write a program that adds a check letter to an eight-digit number. The check…
A: Program description : The C++ program, CheckLetter.cpp ask user to enter the 8-digit number .Then…
Q: Write a function abs_nums (numbers) that takes a list of numbers as a parameter and returns a list…
A: 1. Declare function abs_nums with parameter nums a. run loop from 0 to length of list i.…
Q: Define a function named hide_middle_of_words (words_list) which takes a list of words as a parameter…
A: python source code def hide_middle_of_words(words_list): item = [] for i in words_list:…
Q: 16-Write a function called find_integer_with_most_divisors that receives a list of integers and…
A: Since the programming language is not specified in the question, so I am using python programming…
Q: A user enters a list of positive integers until it enters -1 which marks the end of input and wants…
A: The program is written in C Programming. Check the program screenshot for the correct indentation.…
Q: Write a function to return a list of the Fibonacci sequence up to x terms The Fibonacci Sequence is…
A: Please refer below for your reference: def fibonnaci(n): n1, n2 = 0, 1#first two terms…
Q: ite a function sum_and_print(nums) that takes a non-empty list of integers nums as a parameter and…
A: Lets see the solution.
Q: Question 2: Write a function that takes a string as its only argument and returns a sorted list of…
A:
Q: Write a function called basic_sum(numbers) that takes as input a list of numbers. The list of…
A: Program : list1= [8,9,10,11] sum=sum(list1) Print(total)
Q: Introduction In this lab, you are writing a function slashes_to_written(date_list) that gets the…
A: def slashes_to_written(date_list): month_names = { 1: "January", 2: "February", 3: "March", 4:…
Q: Write a function called average that takes AS MANY ARGUMENTS as the caller wants to give, and…
A: Note: Since no programming language is mentioned, the program has been implemented in Java. Java…
Q: python Write a function which accepts two sequences of numbers from the user, each number separated…
A: Step 1: Define a function findCommon() that prompts and accepts two sequence of numbers from the…
Q: A ball thrown at an angle 0 with initial speed vo on Earth follows a trajectory f(x) = I tan 0 + Yo…
A: CODE : import math #define function trajectory that takes 3 inputs: list,number,number #output:…
Q: need solution very quickly please write a function to check if list is full or not data structure…
A: Input of the program : Size of list Elements of list Output of the program : Check whather the…
Q: Write a function that takes a list containing characters and numbers as input (in random orders) and…
A: # Function to Separate String and Integer from a list def String_Int_Separator(lst): #…
Q: 9. You are a class teacher at a kindergarten school. As a task, you asked your students to write a…
A: The program is written in Python. Please check step 2 for source code
Q: code should be python: write a function that allows the input of a list of strings as its only…
A: logic:- pass the lst in function call. In function definition , iterate for each word in lst…
Q: (Note: this is a searching problem. Your function should return 1 to mean “Yes, the word is in the…
A: THE CODE HAS BEEN WRITTEN IN STEP 2. I HOPE YOU FIND THIS HELPFUL.
Q: Write a function little_sum (number_list, limit) that returns the sum of only the numbers in…
A: limit is number is less than or equal all number sum in below function.
Q: Write a function that returns the intersecting point of two lines. The intersecting point of the two…
A: The python code is given below:
Q: Define a function named get_word_lengths_tuple(sentence) which takes a sentence as a parameter. The…
A: Here is the python code: See below steps for code and output:
Q: Write a function that takes in 2 lists and checks whether they have the same elements in the same…
A:
Q: Question 2: write a function that takes a string as its only argument and returns a sorted list of…
A: Code import redef strLetters(isStr): isStr = re.sub('\W+','', isStr ) res=[] str1 =…
Q: In program problem5.py, write a function named sums that takes 3 arguments: 2 lists of integers…
A: A tuple is a data type that store multiple lists of items under a single variable. It is ordered and…
Q: Andrew likes the topic of strings a lot and tries to solve as many problems as he can on this topic.…
A: The sequence of characters is called string and the sequence which can be made out of string is…
Q: Q5. Write a function called findString to determine if one character string exists inside another…
A: #include <stdio.h>//5//function takes two characters string str1 & str2//then searches for…
Q: Write a function that takes a C-string as a parameter and reverses the string. The function will use…
A: 1. To reverse a string a. declare i set to 0 b. declare j set to length of string - 1 c.…
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- SOB 35 - (Block 2 - material covered in Week 13) Write a function that takes a list containing characters and numbers as input (in random orders) and displays as output a string containing the character and a list containing the numbers, e.g., given the lists "("h" 1 2 3 "e" "" 4 5 "'" "o"), your method should output: "hello" and '(1 2 3 4 5 6). Please make sure to test your function and to explain how your code works.Use Standard ML Code: Write a function that returns the factorial of a number. Write a function that sums all numbers in a list of pairs. e.g.: sum_of_pairs [(1, 2), (4, 3), (2, 5)] should return 17 (which is equal to 1 + 2 + 4 + 3 + 2 + 5) Write a function to return a list of second elements in a list of pairs. e.g.: sends [(1, 2), (4, 3), (2, 5)] should return [2, 3, 5]।a- Write a Python function Salary_levels, that takes a list as an argument and returns the number of the high salaries (salary>=5000), the average salaries(1000<=salary<5000, and the low salaries (salary<1000). You can use the following list : salaries= [500,1070,1450,6500,9000,940,450,400,600,2750,1100,8400,1500,900,1200] b- Use the above function to print the counts of the high, average, and low salaries. N.B: the codes of parts a and b should be included in your answer.
- Write a function named mostCharacters that takes a list of strings as an argument and a character as an argument. It then returns the string within the list that contains the highest count of the character. (If there is a tie for the highest count, return a list of all the strings) For example, if you run mostCharacters(["cherry", "tomato", "salad", "shrimp"], 'r') it will return "cherry" If you run mostCharacters(["cherry", "tomato", "salad", "shrimp"], 's') it will return ["salad", "shrimp"]Question 4: Write a function that takes three lists of integers, l1, l2, and l3, and returns a list of all tuples, where each tuple (a,b,c) is such that a is from l1, b is from l2 and c is from l3 and a+b=c. For example, given [1,2,3], [4,5] and [7,8] you should return [(2,5,7), (3,4,7), (3,5,8)]. The returned list must be sorted according to a and b, in ascending order. """ def threeLists(l1, l2, l3):Program - Python Write a function min_max() that takes a list s as an argument, and print the minimum and maximum values along with their ranks, ie, their positions (starting at 1) in the input. Example: my_list = [3, 1, 5, 4, 2] The minimum value is 1 and the rank is 2 in the list The maximum value is 5 and the rank is 3 in. the list Question 4 # your code here my_list = [3, 1, 5, 4, 2] min_max(my_list) Hint: your output should look like this min is 1 rank is 2 max is 5 rank is 3
- 1) Write a function that takes one argument, a list named sample-list. 2 ) If the length of the sample-list is > 8, then use the last element of sample-list and return it in a list. 3) If the length of sample-list is <= 8 and > 4, then return the first elements of sample-list in a list. 4) Otherwise, return the string “This is the third option.”. Please make sure to test your function!!! and explain your code shortly by adding comments to each line.In C++, Write a function that receives a string of characters and return true if the string is in language, otherwise it returns false. You may use following function header (Assume a string is in language if it is read from the left side is the same as it is read from the right side. For example, a-b-d-c is not in the language, a-b-c-a-c-b-a is in language): bool isInLanguage_2(string aString) And I also, want to know if my if statement is incorrect, and if it is how is it incorrect?Use C++ Write a program that gets a list of integers from input, and outputs the integers in ascending order (lowest to highest). The first integer indicates how many numbers are in the list. Assume that the list will always contain less than 20 integers. Ex: If the input is: 5 10 4 39 12 2 the output is: 2 4 10 12 39 For coding simplicity, follow every output value by a space, including the last one. Your program must define and call the following function. When the SortVector function is complete, the vector passed in as the parameter should be sorted.void SortVector(vector<int>& myVec) Hint: There are many ways to sort a vector. You are welcome to look up and use any existing algorithm. Some believe the simplest to code is bubble sort: https://en.wikipedia.org/wiki/Bubble_sort. But you are welcome to try others: https://en.wikipedia.org/wiki/Sorting_algorithm.
- To determine if two lists of integers are equivalent, you must write a function that accepts the lists as input and returns true or false (i.e. contain the same values). The greatest value of each list must be shown if the lists are dissimilar and the procedure is effective.Problem 2Write a program called p2.py that contains a function called less_than_age() that takesa string filename and an integer x as parameters. You can assume that this file containsa list of comma-separated animal names and their ages, similar to the content in thesample file above. This function should store the names of all the animals with age lessthan x in a list and return the list.Again, test your function inside main().Sample output:>>> result = less_than_age(“samplefile_t9.txt”, 4)>>> print(result)[“wombat”, “koala”, “dingo”, “kookaburra”]In C language, Write a function that gets a string containing a positive integer. The function subtracts 1 fromthat integer and puts the obtained value in the string. void str_subtract_one(char* num); For example:- if before we call str_subtract_one(str) we have str==“1997”, then after return str will be “1996”.- if before we call str_subtract_one(str) we have str==“12345678987650”, then after return str will be “12345678987649”.- if before we call str_subtract_one(str) we have str==“100”, then after return str will be “99”. 1. You may assume that the input is always legal, i.e., the string is a positive integer correctly formatted.2. Note that the numbers may be larger than the maximum of int or long. That is, you should not try to convert string to int