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" "I" 4 5 "I" "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.
Q: Question 11 reads a line of input, including leading and embedded spaces, and stores it in a string ...
A: As per company guidelines we are suppose to answer only 1 question. Kindly re-post other question...
Q: Show how to convert a regular expression directly into a context-free grammar.
A: This method is not easy to grasp and may take some time to master. We'll teach you how to make regul...
Q: What is the difference between a client computer and a server computer?
A: A Server computer is a computer on a network that shares resources for others to use. A Client compu...
Q: List some common devices, technologies and business models that have leveraged the internet
A: INTRODUCTION: The word "business model" refers to a company's profit strategy. For both new and exi...
Q: Which of the following state transitions are possible? A Running -> Suspended Blocked -> Running C) ...
A: The following state transitions are possible: E- blocked->ready F- Running->Ready
Q: Define the terms listed below. I The datapath (ii) Processor timer (iii) Clocking in many phases.
A: 1)The Datapath:- A datapath is a collection of functional units such as arithmetic logic units or mu...
Q: C language 1. What is the value of x and y for the following code: int y = 10; int x = ++y;
A: What is the value of x and y for the following code: int y = 10; int x = ++y;
Q: Pervasive computing is essential for the Internet of Things. Show this by giving an example that exe...
A: The internet of things (IOT) is a technology that helps in connectivity of various devices like AC's...
Q: thod, write a program that tells a user to input a stri
A: using mid square method, write a program that tells a user to input a string, then store it in an ha...
Q: this code should be in python: ...
A: Here is the detailed explanation of the program
Q: Relate to the inhabitants of the island of knights and knaves created by Smullyan, where knights alw...
A: Let us assume that A is knight. In that case, we must also assume what A says is true. A says that b...
Q: a. explain the logic of why this code produces this output #include int f(int n,float x); main( ) ...
A: The Output :- 12 4 1 2 2 2 too small x=3.2 Explanation :- STEP1 :-Function call :-p=f(n,y);Here we ...
Q: Verify: a) the truth table of a NOT gate b) the truth table a two-input AND gate c) the truth tab...
A: Let us see the answer:-
Q: Access to the internet and information technologies has widened the social class divide. Explain the...
A: Introduction : The digital gap refers to the discrepancy in access to information technology among d...
Q: This is using Java only... please do help me.. just an Explanation on the second question.. please d...
A: Here, we are explaining the given program. This program is completely about Printing the Integer Val...
Q: Define/Explain the topic fully and identify the role that particular term, concept, or analysis pla...
A: In this question, we are asked to explain three termonoly Explained in the following step
Q: Write a function to be included in an unsorted doubly linked list class, called deleteLast, that wil...
A: Please refer below commented function code called deleteLast to be included in an unsorted doubly l...
Q: You have to take 2 integer numbers from the user & then print true if they are both in the range 70....
A:
Q: Write a Bank Account class in python to manage the account of the users. A user can deposit (add mon...
A: Find an implementation below.
Q: What is the importance of HTML Post and Get Method?
A: In the message body of HTTP POST requests, the client (browser) sends additional data to the server....
Q: What is an enterprise application integration (EAI) system, and is Amazon Web Services one of these ...
A: Enterprise application integration system: Enterprise application integration system is the task of...
Q: what is the code that will print the temp level in commonwealth? co2_sensors = [{"loc_id":1,"cities...
A:
Q: When do you select numbers at random, what does it mean?
A: A random sample or method is one in which all the people or things involved have an equal chance of ...
Q: State & explain any three steps of data processing activity in any transaction processing system
A:
Q: You have been asked to develop a system that will help with planning large-scale events and parties ...
A: activity diagram, model the process context for such a system that shows the activities involved in...
Q: Make a list of the ATAM - basic evaluation outcomes
A: Architecture Tradeoff Analysis :This method is the method used to evaluate the quality features (suc...
Q: What is the rationale for operating systems' usage of such a broad range of partitioning algorithms?
A: What is the rationale for operating systems' usage of such a broad range of partitioning algorithms?
Q: Describe scenarios in which linked lists will be useful.
A: Given: Describe scenarios in which linked lists will be useful.
Q: More than 90% of the microprocessors/micro- controllers manufactured is used in embedded computing
A: The answer is
Q: 2. Let R be the binary relation on A= {a, b, c} with the graphical representation shown below: a Ind...
A: To check reflexive, symmetric and transitive nature of graph.
Q: H.W:- Find the deteminant for the following matrices: 2 3 5. B =0 -2 answer: [B| = -20 -21
A: Here is the detailed explanation of the solution
Q: Let R be a relation on the set of all real numbers, where (x, y) E Rif and only if a y is an integer...
A: 2) Given, Let R be the relation on the set of all real numbers defined where(x,y)ER if and only if ...
Q: In a wireless adhoc network, what are the routing metrics?
A: INTRODUCTION: ROUTING METRIC: A routing metric is a measure that a routing algorithm uses to determi...
Q: 1) The newton function returns the square root of 'x' 2) The limitReached function returns True if ...
A: Introduction: The Newton-Raphson technique, commonly known as Newton's method, is a root-finding pro...
Q: Suppose your friend, Alice is trying to find all the odd numbers that are between X and Y. You want ...
A: Step-1: Start Step-2: Start a for loop i = 92 to 1092 Step-3: Check if every i is not divisible by 2...
Q: 3. Consider the abstract syntax for the following expression language. The constant Zero denotes 0, ...
A: Here we are given the syntax for the expression language and we need to find the semantics for it . ...
Q: Draw a ladder diagram in PLC programming for manually operated standing A+B+B-A- cylinder sequence.
A: Below is the complete solution with explanation in detail for the given question about Ladder Diagra...
Q: Identify two widely utilised system development methodologies. Each method's pros and cons are detai...
A: Introduction: There are several Software Development Methodologies in use today. These are the follo...
Q: Given the following Python code below: co2_sensors = [{"loc_id":1,"cities":{"Quezon City": {"Common...
A: Please find the answer below :
Q: 6. Write a program that will randomly generate 500 integer numbers in the range -249 to 250. Write t...
A: Write a program that will randomly generate 500 integer numbers in the range -249 to 250. Write thos...
Q: A full 3-ary tree with 13 vertices has -- leaves. Answer:
A: As per company guidelines we are suppose to answer only 1 question. Kindly re-post other questions ...
Q: State the difference between parallel processors & coprocessors.
A: In the main processing computer has the arithmetic that can have parallel to the main processor of t...
Q: write a java code to print tH * * * **
A: Code: public class Main {public static void main(String[] args) { for(int i = 1; i <= 10; i+...
Q: Show that in a tree, any edge is a bridge
A: Introduction of a graph We all know a basic thing is that a graph which creates a connection in betw...
Q: what other dangers do such unethical data analytics practices pose to our commercial, national, and ...
A: Below is the complete information about various dangers that are posed to our commercial, national a...
Q: Given 3 images A, B, C and their corresponding feature encodings (A), (B), (C), if the Euclidean dis...
A: Given:
Q: What is the difference between a client computer and a server computer?
A: Introduction: The main distinction between client and server is like a client is a computer or a pro...
Q: In the operation of hard real-time systems, what is the most critical component to consider?
A: Answer is given below :
Q: Make use of a set route and try to send a packet to a host from that location. a route that connect...
A: Introduction: The term "delays" refers to the amount of time the processing packet takes to complete...
Q: Object-oriented design approaches should be set up so that modelling takes precedence over procedure...
A: For example, logical and physical representations of a system, as well as state and dynamic models a...
Step by step
Solved in 2 steps with 1 images
- / In python / def get_new_grades():"""Write a function get_new_grades, such that given a string of grades as an input parameter,returns two objects:the initial grades as a list of numerical valuesas well asa new list with the numerical values, where the scores that are less than 50 are replaced by 50. """ pass3. String (a) Write a Python function that accepts a string s and an integer n with a single digit (i.e., 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9) as its arguments, and returns a new string that replaces every digit n found in s by a new digit that equals to (n + 1) %10. The function returns an empty string if n is not a single digit integer or is negative. COMP132 Assignment #2 replace_string("He330", 3)-> "He440" "He331" replace_string("He330",0)-> replace_string("He330",-4) replace_string("He330", -> 12)-> 11 11 11 11 (b) Write a Python function that accepts a string as the argument, moves the first 3 characters of the string to the end, and prints it out. If the length of the string is less than 3, your function should print an error message. move_string ("Hello") ->loHel move_string ("Hi, My name is Mark.") -> My name is Mark. Hi, move_string ("Hi")->Invalid String# Exercise 6: Create a function that concatonates a two strings and prints the new sentence out. # Ask a user to type in two strings and print out the concatonation by calling your function.
- 09. Python Write the in_order() function, which has a list of integers as a parameter, and returns True if the integers are sorted (in order from low to high) or False otherwise. The program outputs "In order" if the list is sorted, or "Not in order" if the list is not sorted. Ex: If the list passed to the in_order() function is [5, 6, 7, 8, 3], then the function returns False and the program outputs: Not in order Ex: If the list passed to the in_order() function is [5, 6, 7, 8, 10], then the function returns True and the program outputs: In order Note: Use a for loop. DO NOT use sorted() or sort()..PYTHON PROGRAMMING #Finish the favFoods function that takes as input a list of foods and returns a count of the number of times pizza is included in the list of favorite foods def favFoods(x): print(favFoods (['apple', 'banana', 'pizza', 'Pizza', 'ice cream','cupcakes'])) #expected output: 2 print (favFoods (['almonds','spaghetti','pizza', 'kombucha', 'Pizza', 'pizza'])) #expected output: 3***in python only*** use turtle function Define the concentricCircles function such that: It draws a series of concentric circles, where the first parameter specifies the radius of the outermost circle, and the second parameter specifies the number of circles to draw. The third and fourth parameters specify an outer color and an other color, respectively. The outer color is used for the largest (i.e., outermost) circle, and then every other circle out to the edge alternates between that color and the 'other' color. The difference between the radii of subsequent circles is always the same, and this difference is also equal to the radius of the smallest circle. Put another way: the distance between the inside and outside of each ring is the same. Define concentricCircles with 4 parameters Use def to define concentricCircles with 4 parameters Use any kind of loop Within the definition of concentricCircles with 4 parameters, use any kind of loop in at least one place. Call…
- 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 days are here again! 'your function should return the list ['a''d','e','g','h','i','n','p','r','s','y'l Нарру In [ ]: 1 # write your code here 2 # you may add more cells as neededPython (this is not graded this is practice work that is not graded) write and test a function which takes two dates (month, day) list arguments.When the function is called with the two arguments, it returns the number of days betweenthose two dates. Print the returned value. It is assumed that the first date occurs first. Forinstance, if the users calls the function with FUNCTION([12, 10], [12, 20]) as arguments, thereturned value is 10 days. However, if FUNCTION([12, 20], [12, 10]) is called, the returnedvalue is -10 days.Assume February has 28 days.Test data: [10, 30], [5, 20] [1, 30], [5, 25] [5, 25], [1, 30] [1, 1], [12, 31]Exercise 4 Use the function design recipe to develop a function named max min. The function takes a list of integers. (Assume that the list has at least two integers). The function returns the largest and smallest elements in the list as a string. For example, when the function's argument is [10, 3, 5, 6], the function returns “max = 10 and min= 3". For this exercise, your function is not permitted to call Python's min and max functions. It is true that Python offers a very elegant and efficient solution (a version shown below) but in this exercise, we want you to practice writing loops. For now, this wonderful Python solution is not permitted in this lab, but free feel to file it away for later use!
- Programming Language : R programming (R Studio) A twin prime is a prime that has a prime gap of two. Sometimes the term twin prime isused for a pair of twin primes. For example, the five twin prime pairs are (3, 5), (5, 7),(11, 13), (17, 19) and (29, 31). Write a function that returns the number of all twin primepairs between 1 and a given number n.python code. Instructions for each function are given within the quotations. 1)def is_word_from_letters(word, letters): """ Returns True if word is spelled by rearrange all or some of the letters Otherwise returns False Notes: this is different from uses_only function we wrote before, word not only can use only characters in letters, but the number of times it can use a letter is also limited by what is in letters. For example: is_word_from_letters("book", "bok") should be False because we do not have enough letter 'o'. """ return True 2)def get_word_score(word, value_dict): """ Given a word, and a dictionary matching each letter to an int score, calculates the word's score (adding up each letter's score) and return the score. """ return 0 3)def get_legal_word_scores(letters, dictionary, value_dict): """ Given a str of letters that we can use, and a dictionary that contains all legal words allowed in scrabble game, and a value_dict that maps each letter to a score, Returns a…Q4. Write a program that read 2 matrices and has a function which finds their sum. Q5. Write a program that read 2 matrices and has a function which finds their multiplication. Q6. Write a program that handles a list of numbers where it has the following functions - Function that finds their average and sum - Function that finds their maximum and minimum - Function that search for a given number in that list. - Function that count the occurrence of a given number in that list. Then the program should do the following: - Read the list - Find the average and the sum of that list - Find the minimum and the maximum of that list - Count the occurrence of a given number in that list.