Question
Write a Python Function to count the number of elements in a list within a specified range.

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 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.
Write SQL commands for the statements (a) to (h) on the table HOSPITAL

(a) To insert a new row in the HOSPITAL table with the following data: 11,’ Kasif’, 37,’ENT’,’2018-02-25’, 300, ’M’.

(b) To set charges to NULL for all the patients in the Surgery department.

(c) To display patient details who are giving charges in the range 300 and 400 (both inclusive).

(d) To display the details of that patient whose name second character contains ‘a’.

(e) To display total charges of ENT Department.

(f) To display details of the patients who admitted in the year 2019.

(g) To display the structure of the table hospital.

(h) Write the command to create the above table.

Write a function update () to update the record in the binary file “student”, which consist of student number, student name and marks. The updation should be done on the basis of student number entered by the user.

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}

Write a python program using function to print the table of the number. The function should take a numbers as parameter.
What are the adverse effects of technology?
Perfect Edu Services Ltd. is an educational organization. It is planning to setup its India campus at Chennai with its head office at Delhi. The Chennai campus has 4 main buildings – ADMIN, ENGINEERING, BUSINESS and MEDIA

Shortest distances between various buildings:

ADMIN to ENGINEERING 55 m
ADMIN to BUSINESS 90 m
ADMIN to MEDIA 50 m
ENGINEERING to BUSINESS 55 m
ENGINEERING to MEDIA 50 m
BUSINESS to MEDIA 45 m
DELHI Head Office to CHENNAICampus 2175 km

Number of Computers installed at various buildings are as follows:

ADMIN 110
ENGINEERING 75
BUSINESS 40
MEDIA 12
DELHI Head Office 20

(a) Suggest the most appropriate location of the server inside the CHENNAI campus (out of the 4 buildings), to get the best connectivity for maximum no. of computers. Justify your answer.

Which hardware device will you suggest to be procured by the company to be installed to protect and control the internet uses within the campus?

(d) Which of the following will you suggest to establish the online face-to-face communication between the people in the Admin Office of CHENNAI campus and DELHI Head Office?

(a) Cable TV

(b) Email

(c) Video Conferencing

(d) Text Chat

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
Intelligent Hub India is a knowledge community aimed to uplift the standard of skills and knowledge in the society. It is planning to setup its training centers in multiple towns and villages pan India with its head offices in the nearest cities. They have created a model of their network with a city, a town and 3 villages as follows.

As a network consultant, you have to suggest the best network related solutions for their issues/problems raised in (a) to (d), keeping in mind the distances between various locations and other given parameters.

Shortest distance between various locations:

VILLAGE 1 to YTOWN 2 KM
VILLAGE 2 to YTOWN 1.5 KM
VILLAGE 3 to YTOWN 3 KM
VILLAGE 1 to VILLAGE 2 3.5 KM
VILLAGE 1 to VILLAGE 3 4.5 KM
VILLAGE 2 to VILLAGE 3 3.5 KM
CITY Head Office to YHUB 30 KM

Number of computers installed at various locations are as follows:

YTOWN 100
VILLAGE 1 10
VILLAGE 2 15
VILLAGE 3 15
CITY OFFICE 5

Note:
• In Villages, there are community centers, in which one room has been given as training center to this organization to install computers.

• The organization has got financial support from the government and top IT companies.

(a) Suggest the most appropriate location of the SERVER in the YHUB (out of the 4 locations), to get the best and effective connectivity. Justify your answer.

(b) Suggest the best wired medium and draw the cable layout (location to location) to efficiently connect various locations within the YHUB.

(c) Which hardware device will you suggest to connect all the computers within each location of YHUB?

(d) Which service/protocol will be most helpful to conduct live interactions of Experts from Head Office and people at YHUB locations?

Write a python program using function to demonstrate random() along with list, tuple and dictionary. The program should do 3 things: (i) Should create the list of 5 random numbers between 10 to 99. (ii) Should create the tuple of 5 random numbers between 10 to 99. (iii) Should create the dictionary of 5 keys:values random characters as key and ASCII as its value.