A-1: Let l = [−1, −2, . . . , −10] be an existing list. Construct a new list from l by dividing each even
number element in l by 2. Print the new list. Do not use NUMPY library.
A-2: Create a new list containing the following elements using list comprehension:
[1, −1, 2, −2, 3, −3, ..., 9, −9]
A-3: Consider the following coded string. Create a list of all contiguous (connected without space) letters
in the order of their appearance.
"Vjg dguv rtqitcou ctg ytkvvgp uq vjcv eqorwvkpi ocejkpgu ecp rgthqto vjgo
swkemn{0 Cnuq. vjg dguv rtqitcou ctg ytkvvgp uq vjcv jwocp dgkpiu ecp wpfgtuvcpf
vjgo engctn{0 C iqqf guuc{kuv cpf c iqqf rtqitcoogt jcxg c nqv kp eqooqp0"
A-4: In the list obtained after executing task(s) from Part(A-3), remove newline characters (if any).
A-5: For the list obtained after executing task(s) from Part(A-4), for each word in the list do the
following:
Breakdown the word into list of letters.
Convert each of the above letters into integer, using ord() function.
Update the integer values by -2 for all the above integers.
Convert each updated integer value into letter, using chr() function.
Join the updated letters in the order to create new word.
A-6: Join the list of new words obtained after executing task(s) from Part(A-5), into one string of words.
Print the string.
A-7: Create a python program, that does the following:
Ask the user to enter a number from the following choices: 10, 20, 30, 40, 50, 60, 70, 80, 90, 100
Returns the roman numerals and the word form for the entered number.
Hint(A-5): ‘a’ is chr(97), and ord(‘a’) is 97.
Hint(A-7): Use the following list for roman numerals correspondingly to the above numbers:
“X”, “XX”, “XXX”, “XL”, “L”, “LX”, “LXX”, “LXXX”, “XC”, “C”
☞ Note: Solve all the above questions using Python only. Do NOT use Numpy o
Step by stepSolved in 2 steps with 2 images
- LAB: Playlist (output linked list) Given main(), complete the SongNode class to include the function PrintSongInfo(). Then write the PrintPlaylist() function in main.cpp to print all songs in the playlist. DO NOT print the head node, which does not contain user-input values. Ex: If the input is: Stomp! 380 The Brothers Johnson The Dude 337 Quincy Jones You Don't Own Me 151 Lesley Gore -1 the output is: LIST OF SONGS ------------- Title: Stomp! Length: 380 Artist: The Brothers Johnson Title: The Dude Length: 337 Artist: Quincy Jones Title: You Don't Own Me Length: 151 Artist: Lesley Gorearrow_forwardReplace XXX in the following function header for a doubly-linked list: ListInsertAfter(listName, currentNode, XXX) Group of answer choices headNode tailNode middleNode newNodearrow_forwarddef count_types(lst: List[Any]) -> List[int]: """ Given a list <lst> of random types, return the number of occurrences of each type, in the form of a list, in the order that they were first seen. For example, if the input ['str1', 1, 'str2'], the output would be [2, 1], as a string type appears first, and occurs twice in the list. An integer type appears next, and only occurs once in the list. Another example could be [True, 'str1', 1, False, 'str2', True], where the output would be [3, 2, 1], as a boolean type appears first, and occurs three times in the list. A string appears next, and occurs twice in the list. Finally, an integer appears next, and occurs once in the list. """don't use any import, dictionaries, or dictionary methods or try-except statements.arrow_forward
- Create class Test in a file named Test.java. This class contains a main program that performs the following actions: Instantiate a doubly linked list. Insert strings “a”, “b”, and “c” at the head of the list using three Insert() operations. The state of the list is now [“c”, “b”, “a”]. Set the current element to the second-to-last element with a call to Tail() followed by a call to Previous()Then insert string “d”. The state of the list is now [“c”, “d”, “b”, “a”]. Set the current element to past-the-end with a call to Tail() followed by a call to Next(). Then insert string “e”. The state of the list is now [“c”, “d”, “b”, “a”, “e”] . Print the list with a call to Print() and verify that the state of the list is correct.arrow_forwarddef grade_manipulation(grade_list): ''' Question You are working as a TA and the professor asks you to handle the uncleaned student grades. - First, substitute all grades that are None with a 0 - Second, reverse the order of the student grades - Third, change the type of the list to a tuple Args: grade_list (list) Returns: tuple >>> grade_manipulation([67, 95, 60, None, 100]) (100, 0, 60, 95, 67) ''" # print(grade_manipulation([67, 95, 60, None, 100])) # print('---')arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY