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 python program using function InQ(), DelQ() and DisplayQ() to implement the Queue. The program will store details of the flights
i.e Flight Number, Flight Name and Fare.
Write a program to count no. of records in csv file and display the records in tabular form. Admno, Name, Eng, Hindi, Maths, Sci, Ssc 1101 1102 1103 1104 1105 Tejas Swati Sam Imran Heena 80 90 90 75 85 85 85 80 76 90 95 94 64 80 90 94 96 85 80 75 86 80 70
Write the Pseudocode to sort the list using Bubble sort– to sort a list A in ascending order
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 (g) on the table BANK

(a) Display details of all the FD whose rate of interest is NOT NULL.

(b) Display amounts of various FD from the table Bank. An FD Amount should appear only once.

(c) Display the number of months of various loans from the table Bank. A month should appear only once.

(d) Display the Customer Name and FD Amount for all the Bank which do not have a number of months is 36.

(e) Display the Customer Name and FD Amount for which the FD amount is less than 500000 or int_rate is more than 7.

(f) Display the details of all FD which started in the year 2018.

(g) Display the details of all FD whose FD_Amount is in the range 40000 to 50000.

Write a menu based python program using function to find TSA and Vol of Cylinder, Sphere and Cone according to choice entered by the user.
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.
Granuda Consultants are setting up a secured network for their office campus at Faridabad for their day to day office and web based activities. They are planning to have connectivity between 3 buildings and the head office situated in Kolkata. Answer the questions (a) to (d) after going through the building positions in the campus and other details, which are given below:

Distances between various buildings:

Building “RAVI” to Building “JAMUNA” 120m
Building “RAVI” to Building “GANGA” 50m
Building “GANGA” to Building “JAMUNA” 65m
Faridabad Campus to Head Office 1460km

Number of computers:

Building “RAVI” 25
Building “JAMUNA” 150
Building “GANGA” 51
Head Office 10

(a) Suggest the most suitable place (i.e. block) to house the server of this organization. Also give a reason to justify your suggested location.

(b) Suggest a cable layout of connections between the buildings inside the campus.

(c) Suggest the placement of the following devices with justification:

(i) Switch

(ii) Repeater

(d) The organization is planning to provide a high speed link with its head office situated in KOLKATA using a wired connection. Which of the following cable will be most suitable for this job?

(i) Optical Fiber

(ii) Co-axial cable

(iii) Ethernet cable

Write definition of a Method AFIND(CITIES) to display all the city names from a list of CITIES, which are starting with alphabet A.

For example:If the list CITIES contains[“AHMEDABAD”,”CHENNAI”,”NEW DELHI”,”AMRITSAR”,”AGRA”]The following should get displayedAHEMDABADAMRITSARAGRA

WAP to find the sum of first n terms of the following series:
$x-x^2+x^3+\ldots$
WAP to generate n lines of the following pattern on the computer screen: