Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Kalinjar Fort is a popular tourist place in Bundelkhand, Utter Pradesh. Everyday peoples registered to visit Fort as token provided based on first come basis. Everyday limited numbers of peoples are allowed to visit. The management selects a number N1 randomly every day and generates another number N2 as count of the total number of set bits (i.e., total no. of 1s) in binary representation of all numbers from 1 to N1. For example, N1=3 then N2=4 [1(01) +2(10) +3(11)]. So, write a python module CountBit.py to find N2 using N1. You need to import this module , define a function Get_Token(n) which takes a number and return value as shown in example by calling the appropriate function implemented in CountBit.py module.

 

 

Example-1

Example-2

Example-3

Input:

3

 

Output:

4

 

Input:

7

 

Output:

12

Input:

8

 

Output:

13

 



Given a string of numbers S, the task is to find the maximum value from the string S, you can add a ‘+’ or ‘*’ sign between any two numbers.

For example, S=891. As 8*9*1 = 72 and 8*9+1 = 73. So, 73 is maximum.

Write a python module MaxValue.py for solve the above task. You need to import this module ,define a function Find_Max(n) which takes a string and return maximum value or error message as shown in example by calling the appropriate function implemented in MaxValue.py module. Also handle the possible exceptions and display the exception message in form of string.

 

Example-1

Example-2

Example-3

Example-4

Input:

01231

 

Output:

10

Input:

891

 

Output:

73Input:

0000

 

Output:


Input:

45f

 

Output:

Invalid Number



You work in XYZ Corporation as a Data Analyst. Your corporation has told you to work with the statistics. 


1. Create a table in excel, table should have 2 columns named x and y.

a. ‘x’ column should have numbers from 1-5.

b. ‘y’ should have numbers 2,4,5,4,2

c. Now calculate the mean of columns x and y.

d. Calculate the mode of column x.

e. Calculate the standard deviation of column y.

f. Atlast calculate the range of columns x and y separately


You work in XYZ Corporation as a Data Analyst. Your corporation has told you to visualize the mtcars.csv dataset with various plots.

1. Plot the area chart for the colmns: ‘am’ and ‘carb’.

a. Set the ‘am’ on the x-axis.

b. Set the ‘carb’ on the y-axis.

c. Provide the x-axis label as Transmission.

d. Provide the y-axis labe as Number of carburetors.

e. Provide the title as Transmission vs Number of carburetors.



You work in XYZ Corporation as a Data Analyst. Your corporation has told you to visualize the mtcars.csv dataset with various plots.


1. Plot a pie chart for columns: ‘cyl’ and ‘model’ form the mtcars.csv data frame


You work in XYZ Corporation as a Data Analyst. Your corporation has told you to visualize the mtcars.csv dataset with various plots. Tasks to be performed:

Dataset Link 1. Generate a bar plot graph for the columns ‘carbs’ and ‘gear’.

a. Map the ‘carbs’ onto the x-axis.

b. Map the ‘gear’ onto the y-axis.

c. Provide the x-axis label as Number of carburetors.

d. Provide the y-axis label as Number of forward gears.

e. Set the title as carbs vs gear.



You work in XYZ Corporation as a Data Analyst. Your corporation has told you to visualize the mtcars.csv dataset with various plots. Tasks to be performed:

Dataset Link 1. Plot a histogram for the column ‘wt’.

a. Map the ‘wt’ onto the x-axis.

b. Provide the x-axis label as ‘weight of the cars’.

c. Provide the y-axis label as ‘Count’

d. Set the number of bins as 30.

e. Set the title as ‘Histogram for the weight values


Write a Python program that reads a number and finds the sum of the series of 1 +11 + 111 + 1111 + ….+N terms.


Math Quiz

Write a program to print the following,


Sample Input 1

1 3 4 5 6

5

3 5

Sample Output1

12


Ordered Matrix


Given a M x N matrix, write a program to print the matrix after ordering all the elements of the matrix in increasing order.


Input

The first line of input will contain two space-separated integers, denoting the M and N.

The next M following lines will contain N space-separated integers, denoting the elements of each list.


Output

The output should be M lines containing the ordered matrix.

Note: There is a space at the end of each line.


Explanation

For example, if the given M is 3 and N is 3, read the inputs in the next three lines if the numbers given in the next three lines are the following.


1 20 3

30 10 2

5 11 15


By ordering all the elements of the matrix in increasing order, the ordered matrix should be


1 2 3

5 10 11

15 20 30



Sample Input 1

3 3

1 20 3

30 10 2

5 11 15

Sample Output 1

1 2 3

5 10 11

15 20 30


Sample Input 2

2 5

-50 20 3 25 -20

88 17 38 72 -10

Sample Output 2

-50 -20 -10 3 17

20 25 38 72 88


Sum of Non-Diagonals


As the creative content member of your newspaper company, you are given the task to publish a puzzle in your local newspaper. For a given MxM integer matrix, the task is to print the sum of all elements other than the diagonal elements,Both the diagonals are to be excluded.


Input

The first line of input is a positive integer M.

The next M lines of input contain M space-separated integers.


Output

The output is an integer that represents the sum of all the numbers in the matrix as mentioned above.


Sample Input1

3

4 1 3

2 5 6

1 2 3

Sample Output1

11


Sample Input2

5

1 2 2 3 3

4 4 5 6 7

9 8 7 6 5

9 2 3 8 8

-4 -2 -2 4 -7

Sample Output2

63


Friend and Enemy


A group of F friends went to a haunted house.Each member was given a shirt with a number on it ranging from 1 to F. As they entered the haunted house, one of them was kidnapped and an enemy joined them.But unfortunately, the enemy didn't wear the shirt with the same number as the kidnapped one, instead wore the same as some other person.Find the numbers on the shirts of the enemy and the kidnapped person.


Input

The input is a single line containing space-separated positive integers from 1 to F.


Output

The output should be a single line containing the shirt numbers of the enemy and kidnapped person separated by a space.


Explanation

The given array is 3 1 5 2 1


In the range from 1 to 5, the number 1 has occured twice and 4 is the missing number. So, 1 belongs to the enemy's shirt, and 4 belongs to kidnapped.Hence, the output should be 1 4.


Sample Input1

3 1 5 2 1

Sample Output1

1 4


Sample Input2

1 2 2 4

Sample Output2

2 3


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS