Question
Write AddClient(Client) and DeleteClient(Client) methods in python to add a new Client and delete a Client from a List of Client Names, considering them to act as insert and delete operations of the queue data structure.

Answer

Get the step-by-step solution for this question inside the Vidyadip app.

Get the answer in the app

Need a full question paper?

Generate a complete, print-ready paper with questions like this in minutes — across 16+ boards, with answer keys.

Start Generating Free

Similar questions

Write python program using function to find the sum of first n terms of the following series:

where n and x have to be input from the user. The function should have two parameter n and x and return the sum of the series.

Answer the following questions based on dataset given below:

TNO Tname Tadd Salary
0 T01 Amit 123 Paschim Vihar 23000
1 T02 Rajesh 6/11 Ramesh Nagar 34000
2 T03 Binny 5 West Punjabhi Bagh 12000
3 T04 Charu 23Malviya Nagar 45000
4 T05 Meenakshi 19 Meera Bagh 34000

(i) To write the statement to import the required library.

(ii) To create the data frame from the above dictionary.

(iii) To print the data frame.

(iv) To print the name columns.

(v) To print the complete information of the data frame.

(vi) To print the index of data frame.

(vii) To print the various attributes of the data frame i.e Shape, Dimensions, Columns and number of records.

(viii) To print the records whose salary is greater than 5000.

(ix) To create another data frame which will store all the records of the teacher whose salary is greater than 5000.

(x) To display the Salary.

(xi) To set the index to the column 'Tname'.

(xii) To display the record of 'Amit'.

(xiii) To display the record fo 'Amit' and 'Binny'

(xiv) To display the Salary and Address of 'Amit' and 'Binny'.

(xv) To display the records of the teachers whos are earning salary more than 10000.

(xvi) To display the records of the teachers whos are earning salary less than 40000.

(xvii) To add new column Dearness Allowance with any values.

(xviii) To add new column "HRA" using .loc().

(xix) To add new column tax using assign().

(xx) To display the HRA column.

(xxi) To display the records of the Teachers who have HRA of more than 500.

(xxii) To add a new column Total Salary which is to be calculated as Salary + HRA - Tax.

(xxiii) To fill all NaN values with 5000.

(xxiv) To replace all the NaN with space.

(xxv) To Update the new colum with values as Salary + HRA + Dearness Allowance - Tax

Write the output of the given commands:

Write a python program to accept the list as parameter and print the prime numbers of the list.
WAP using function to change the alternate index value of the element.

Answer the questions with reference to below data frame:

class order max_speed
falcon bird Falconiformes 389.0
parrot bird Psittaciformes 24.0
lion mammal Carnivora 80.2
monkey mammal Primates NaN
leopard mammal Carnivora 58.0

(i) To print the class wise sum.

(ii) To print the order wise mean

(iii) To sort the index.

(iv) To print the sum of the class wise along with orders columns indexing.

(v) To count the records.

Write a Python program to push all zeros to the end of a given list a. The order of the elements should not change.

Write a script to create a list of 10 random integers and display it. Then input an integer from the user and check whether it is present in the list (use in operator) and display an appropriate message.

How to add an Index, row, or column to a Pandas DataFrame?
p>Suppose we want to sort the following list of 7 elements in ascending order using insertion sort

Write the complete steps to sort the above along with each pass explanation.

Write a python program using function to print the table of the number. The function should take a numbers as parameter.