Concept explainers
Please answer the ques in python with showing the answers ( There is only 1 ques in 2 steps)
Step 1:
Demonstrate your knowledge of zip and f-strings in your solution
Given 2 related lists :
names=['Joe', 'Amy', 'Lil', 'Poe', 'Ali', 'Sid'] grades=[65, 63, 89, 96, 59, 81]
Write a program to output who passed and who failed. Passing is greater than or equal to 65.
Output:
Joe, you passed!
Amy, you need to study more!
Lil, you passed!
Poe, you passed!
Ali, you need to study more!
Sid, you passed!
Step 2:
Demonstrate your ability to nest a for loop inside a for loop. Create 2 lists:
fruits = apple, banana, cherry descriptions = sweet, tasty
Write the program whose output is:
Output:
sweet apple
sweet banana
sweet cherry
tasty apple
tasty banana
tasty cherry
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 4 images
- Must show it in Python: Please show step by step with comments. Please show it in simplest form. Please don't use any functions Please don't use any def func ()arrow_forwardUsing 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…arrow_forwardPlease solve issue and provide code in Pythonarrow_forward
- Given a list of n integers, write a C++ program to sort these integers usingmerge sort. Print to the screen the sorted list.The program requires that integers in the list are from user input. You can make theassumption that user input numbers are all integers and there is no improper input. Additional requirements and reminders (IMPORTANT): 1) You must use the merge sort algorithm to sort the list of integers. You mustuse recursion in your program.2) The list of integers must from user input. You may not hardcode it in your program.arrow_forward(python) Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follows. Then, get the last value from the input, and output all integers less than or equal to that value. Ex: If the input is: 5 50 60 140 200 75 100 the output is: 50 60 75 The 5 indicates that there are five integers in the list, namely 50, 60, 140, 200, and 75. The 100 indicates that the program should output all integers less than or equal to 100, so the program outputs 50, 60, and 75. Ex. if the input is: 72532272827253128 the output is: 2527282725 Such functionality is common on sites like Amazon, where a user can filter results. Utilizing functions will help to make your main very clean and intuitive. Your code must define and call the following two functions:def get_user_values()def ints_less_than_or_equal_to_threshold(user_values, upper_threshold) Note: ints_less_than_or_equal_to_threshold() returns the new array.arrow_forwardI need to solve this in C++ code When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This can be done by normalizing to values between 0 and 1, or throwing away outliers. For this program, adjust the values by subtracting the smallest value from all the values. The input begins with an integer indicating the number of integers that follow. Assume that the list will always contain less than 20 integers. Ex: If the input is: 5 30 50 10 70 65 the output is: 20 40 0 60 55 For coding simplicity, follow every output value by a space, even the last one. Your program must define and use the following function:int GetMinimumInt(vector<int> listInts) Note: This is a lab from a previous chapter that now requires the use of a function.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education