While taking a viva class teacher decides to take the viva of 2 roll numbers at a time. For
this he calls out the roll numbers from the roll number list as: one roll no. from 1st nth roll number and 2nd roll number from the nth last roll number. For example if the numbers are
roll-num=[31,25,4,22,5,43,11,30,6,17] and n=3 the one roll number for viva is 4 and 2nd roll number for viva is 30. Give fixed input.
Narendra is given a list containing non-repetitive numbers. You need to write a python function se-L(X) which takes input list X and returns five lists , one contains all prime numbers in A , 2nd one contain composite numbers in A , the third list contains all in A which are divisible by 2 , 4th and 5th list contain numbers divisible by 3 and 5 respectively
For example if X = [1,2,3,4,5,12,25,30,37] then 1st list = [2,3,5,37] , 2nd list=[4,12,25,30]
3rd list=[2,4,12,30] , 4th list=[3,12,30] and 5th list=[5,25,30] . Specify input in fixed form.
You have given A and B as2 lists which may have repeated elements in respective list. Write a python function mg-L(A,B) which takes list A and B as input and returns a merged list. The function will merge the list B with A (means the list A will be expanded) such that the resultant A
still contain no duplicates. Specify input in fixed form. Use only list operations. For example if
A =[2,4,8,2,1] and B=[10,4,3,8,7] merged-list =[1,2,3,4,7,8,10]
While taking a viva in class, the teacher decides to take the viva of two roll numbers at a time. For this she calls out the roll numbers from the list of roll numbers as: One roll number from the first nth roll number and Second roll number from the nth last roll number. For example if the numbers are: rollnum=[21, 24, 45, 6, 7, 23, 9, 11, 15, 18], and n=4, then :One roll number called for viva is 6 and second roll number called for viva is 9.
You need to write a python function which take a list A and nth roll number as input and return first nth roll number and Second roll number from the nth last roll number as shown in example. If nth roll number is not lies in the range of list, then function will return "n is not in range" in place of first roll number and empty string (“”) in place of second roll number.
Example-1
Example-2
Input:
[21, 24, 45, 6, 7, 23, 9, 11, 15, 18]
20
Output:
n is not in range
Input:
[21, 24, 45, 6, 7, 23, 9, 11, 15, 18]
5
Output:
7
23
write a python function Separate_List(A) which take list A as input and return five lists, one contains all prime numbers in A, second one contains composite numbers in A, the third list contains all numbers in A which are neither divisible by 2, fourth and fifth list contains number divisible by 3 and 5 respectively.
Example-1
Example-2
Input:
1
2
3
4
5
10
15
20
30
Output:
[2, 3, 5]
[4, 10, 15, 20, 30]
[2, 4, 10, 20, 30]
[3, 15, 30]
[5, 10, 15, 20, 30]
Input:
1
3
5
6
7
8
9
10
Output:
[3, 5, 7]
[6, 8, 9, 10]
[6, 8, 10]
[3, 9]
[5, 10]
You have given A and B as two lists with may have repeated element in the respective list. Write a python function Merge_List(A, B) which take list A and B as input and return a merged list. The function will merge the list B with A (means the list A will be expanded) such that the resultant A still contain no duplicates.
Example-1
Example-2
Example-3
Input:
A:
1
2
3
4
5
B:
1
1
1
11
2
3
Output:
[1, 2, 3, 4, 5, 11]
Input:
A:
1
2
3
4
5
B:
1
2
3
4
5
Output:
[1, 2, 3, 4, 5]
Input:
A:
1
2
3
B:
4
5
Output:
[1, 2, 3, 4, 5]
Explain the debugging process and explain the debugging facilities available in the IDE.
Evaluate how the debugging process can be used to help develop more secure, robust applications.
This lab is a warm-up for the next assignment. We will learn to build a multi-threaded application. You will write a function that will simulate a long task. You will call the first method a number of times sequentially and record the time it takes to complete. They will call the first method again but in a threaded manner and time, the execution and then compare the two times. Description Create three functions:1.Create a function to the following:a.Take a string argument (name).b.Create a loop that will run 100 000 times. In this loop, the program will sleep 0.0001 seconds.c. After the completion of the loop, prints its name and a brief message.2.Create a second function to do the following:a. Takes a number argument (times to execute the loop).b.Store the current time. c.Call the function in step 1 the required number of times (sequentially).d.Check the elapsed time after the above calls are complete. e. Print the results as well as a brief message.