Python Homework Help

Search for question

Questions & Answers

Problem 1 15pts: 1a) 3pts-In NumPy, create an array of points between -5 and 11.323 with spacing .0285. If you can not do this exactly, how close can you g 1b) 3pts - Using vectorization, plot f(x) = 3x¹+3x²+2 for-5≤ x ≤ 11.323. Make sure your graph is labeled. 1c) 3pts - Using vectorization in Python, find the sum + (( 4 )*'- * (4) + ¹) for n = 30, 50. 1d) 3pts - For the integers less than 10,000, what is the sum of those numbers which are divisible by 7, 13, or 18?


16. Because only one radio button in a group can be selected at any given time, they are said to be a. mutually exclusive b. dependent c. selectively unique d. interdependent


The elif statement allows you to check multiple expressions for TRUE and execute a block of code as soon as one of the conditions evaluates to TRUE. Similar to the else, the elif statement is optional. However, unlike else, for which there can be at the most one statement, there can be an arbitrary number of elif statements following an if. syntax Core Python does not provide switch or case statements as in other languages, but we can use if..elif...statements to simulate switch case as follows -


Enter .17"seed (idnum+101);tstar=np.round(120+20*rand());t=[120]*4+[130]*4+[140]*4;s=[56.5,55.9,59.67,57.59,58.6,63.3,59.54,60.45,61.93,67.2,64.74,61.1]" in the Spyder? console. What is the value of tstar


17. What value is assigned to decTaxes by the following program segment, assuming that the user enters 50000 into the textbox txtSalary.Text? Dim decSalary, decTaxes As Decimal decSalary = CDec (txtSalary.Text) If (decSalary > 50000) Then decTaxes = .40 *decSalary ElseIf (decSalary > 40000) Then decTaxes= .30 * decSalary ElseIf (decSalary > 30000) Then Else decTaxes= .10 * decSalary End If а. 20000 b. 15000 с. 10000 d. 5000 decTaxes = .20 * decSalary


27. Which statement tests the value of an expression once and then uses that value to determine the result? а.Nested If b. If...Then...ElseIf C.If...Then d. Select Case


Assignment-1 (35pts) Implement totally ordered multicasting using Lamport's algorithm. Each process conducts local operations and numbers them as PID.EVENT_ID. After each operation is done, a process multicasts the event to all other processes in the distributed system. The expected outcome of this assignment is that events occurred at different processes will appear in the same order at each individual process. To realize such a total order of events, each process maintains a buffer for received events and follow the rules on slide 19 in Lecture 6 when delivering the events. In this assignment, the delivery of events is simply printing them on screen, in the format of CURRENT_PID: PID.EVENT_ID. HINT: You may use two threads in each process to handle the communication and deal with message delivery, respectively. Refer to the multi-threaded server example discussed in class. The communication thread enqueues updates in a buffer, from where the delivery thread enforces a total order of events. The communication thread is also responsible for sending acknowledgements for received messages.


Problem 11.4 - Keeping track of Time Elapsed in a Race Write a function called mul_time that takes a Time_Elapsed object and a number and returns a new Time_Elapsed object that contains the product of the original object and the number. Then use mul_time to write a function that takes a Time_Elapsed object that represents the finishing time in a race, and a number that represents the distance, and returns a Time object that represents the pace (time per mile). The function should return a nicely formatted pace in hour, minutes and second per mile


8. Implement a solution to the Deutsch oracle problem as discussed in lectures in Qiskit (using the Deutsch-Jozsa Algorithm). (10 marks)


I Complete the function favoriteFlower). Note that the program will not run as is because the function is incomplete. The purpose of the function is to determine if the given flower is in the top three of my favorite flowers. The starter file defines a list of favorite flowers that is ordered most favorite to least favorite. Please pass the flower name and the flower list as arguments in the function. The expected output is


No Question Found forPython

we will make sure available to you as soon as possible.