Question
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. If it is present, find its location in the list using index() method and remove it from the list using pop() method. If the element is not present, then display an appropriate message.

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 a menu driven program to do the following option on binary file “Student”. The program should implement through list which contains student number, student name and marks. Student Menu ------------------ 1) Add New Student 2) Display student details 3) Search student 4) Update a Record 5) Delete a Record 6) Save & Quit
Write a menu driven python program using function Push(), Pop() and Display() to implement the stack. The program will store the name of the books.
Write Push(Book) and Pop(Book) methods in Python to Add a new Book and Remove a Book from a List of Books, considering them to act as PUSH and POP
operations of the data structure Stack.
How can one protect from cyber fraud?

Write a program to generate a dictionary that contains (i, i*i) such that it is an integral number between 1 and n (both included) and then the program should print the dictionary.
For the following input is supplied to the program:
Then, the output should be:
{1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49, 8: 64}

Consider the following table Bank.

Table: Bank

AccNo Cust_name FD_Amount Months Int_Rate FD_Date
1001 Arti Gupta 30000 36 6.00 2018-07-01
1002 Dilip Lal 50000 48 6.75 2018-03-22
1003 Navin Gupta 30000 36 NULL 2018-03-01
1004 D.P. Yadav 80000 60 8.25 2017-06-12
1005 Jyoti Sharma 20000 36 6.50 2017-01-31
1006 Rakesh Kumar 70000 60 8.25 2018-06-15
1007 K.D. Singh 50000 48 NULL 2018-07-05
1008 Anjali Sharma 60000 48 6.75 2017-04-02
1009 Swati Garg 40000 42 6.50 2018-06-15
1010 Rupinder Kaur 25000 36 6.50 2018-09-27

Write SQL commands for the statements (a) to (h) on the table Bank

(a) Display the details of all FD whose rate of interest is in the range 6% to 7%.

(b) Display the Customer Name and FD Amount for all the loans for which the number of Months is 24, 36, or 48(using IN operator).

(c) Display the Account Number, Customer Name and FD Amount for all the FD for which the Customer Name ends with “Sharma”.

(d) Delete the records of “Rupinder Kaur”.

(e) Add another column Maturity_Amt of type Integer in the Bank table.

(f) To find the average FD amount. Label the column as “Average FD Amount”.

(g) To find the total FD amount which started in the year 2018?

(h) Update Maturity Amount of all bank customers.

a. Maturity Amount = (FD_Amount*Months* Int_rate)/(12*100)

Write a program to implement the stack using list.
WAP to find the sum of first n terms of the following series:
$1+ x +\frac{x^2}{2}+\frac{x^3}{3}+\ldots$
WAP to generate n lines of the following pattern on the computer screen:
Write a script to create a list of 10 random floating point numbers and then
(a) Display this list of numbers
(b) Find the largest and smallest numbers present in the list (without using max() and min() functions)