Question
Write python program using function to find the sum of first n terms of the following series: x - x2 + x3 - . . . 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

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 python program using function to accept a list as parameter and print all the even number in the list.
Write algorithm for POP(Remove) operation in stack.
Write algorithm for insert operation in Queue.
Uplifting Skills Hub India is a knowledge and skill community which has an aim to uplift the standard of knowledge and skills 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 distances between various locations:

VILLAGE 1 to B_TOWN 2 KM
VILLAGE 2 to B_TOWN 1.0 KM
VILLAGE 3 to B_TOWN 1.5 KM
VILLAGE 1 to VILLAGE 2 3.5 KM
VILLAGE 1 to VILLAGE 3 4.5 KM
VILLAGE 2 to VILLAGE 3 2.5 KM
A_CITY Head Office to B_HUB 25 KM

Number of Computers installed at various locations are as follows:

B_TOWN 120
VILLAGE 1 15
VILLAGE 2 10
VILLAGE 3 15
A_CITY OFFICE 6

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 B_HUB (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 B_HUB.

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

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

WAP using Function to take an list as parameter and print Second largest elemennt.
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 a python program using method to create the list of numeric values and search the number in the list using Binary Search Technique.
Trine Tech Corporation (TTC) is a professional consultancy company. The company is planning to set up their new offices in India with its hub at Hyderabad. As a network adviser, you have to understand their requirement and suggest them the best available solutions. Their queries are mentioned (a) to (d) below.

Block to Block distances (in Mtrs.)

FROM To Distance
Human resource Conference 110
Human resource Finance 40
Conference Finance 80

Number of computers in each of the blocks/Center is as follows:

Human resource 25
Finance 120
Conference 90

(a) What will be the most appropriate block, where TTC should plan to install the server?

(b) Draw a block to block cable layout to connect all the buildings in the most appropriate manner for efficient communication.

(c) What will be the best possible connectivity out of the following, you will suggest to connect the new setup of offices in Bangalore with its London based office?

Satellite Link, Infrared, Ethernet cable

(d) Which of the following devices will be suggested by you to connect each computer in each of the buildings.

Switch, modem, Gateway

Consider the following tables WORKER and PAYLEVEL and answer (a) and (b) parts of this question:

Relation: WORKER

ECODE NAME DESIG PAYLEVEL DOJ DOB
11 Radhey Shyam Supervisor P001 13-Sep-2004 23-Aug-1981
12 Chander Nath Operator P003 22-Feb-2010 12-Jul-1987
13 Fizza Operator P003 14-June-2009 14-Oct-1983
15 Ameen Ahmed Mechanic P002 21-Aug-2006 13-Mar-1984
18 Sanya Clerk P002 19-Dec-2005 09-June-1983

Relation: PAYLEVEL

PAYLEVEL PAY ALLOWANCE
P001 26000 12000
P002 22000 10000
P003 12000 6000

(a) Write SQL commands for the following statements:

(i) To display the details of all WORKERs in descending order of DOB.

(ii) To display NAME and DESIG of those WORKERs whose PLEVEL is either P001 or P002.

(iii) To display the content of all the WORKERs table, whose DOB is in between ’19-JAN- 1984 ’and ’18-JAN-1987 ’.

(iv) To add a new row with the following: 19, ‘Daya kishore ’, ‘Operator ’, ‘P003 ’, ’19-Jun-2008 ’, ’11-Jul-1984 ’

(b) Give the output of the following SQL queries:

(i) Select count(plevel), plevel from worker group by plevel;

(ii) Select max(dob), min(doj) from worker;

(iii) Select name, pay from worker w, paylevel p where w.plevel=p.plevel and w.ecode <13;

(iv) Select plevel, pay+allowance from paylevel where plevel=’p003 ’;

Write a script to create an empty list and then
(a) Input the names of 10 students and store them in the list using concatenation operator
(b) Display this list of names in reverse order