Python Answers

Questions answered by Experts: 5 288

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

  1. Write a program to determine and display the greater of two numbers.


‣ Inputs: Two unknown numbers <num1>, <num2>

‣ Output: num1 or num2, whichever is greater


Diamond

Given an integer value

N, write a program to print a number diamond of 2*N -1 rows as shown below.Input

The first line of input is an integer

N.Explanation

In the given example, the number of rows in the diamond is

5.So, the output should be

....0....

...000...

..00000..

.0000000.

000000000

.0000000.

..00000..

...000...

....0....


Digit 9

You are given

N as input. Write a program to print the pattern of 2*N - 1 rows using an asterisk(*) as shown below.Note: There is a space after each asterisk * character.Input

The first line of input is an integer

N.Explanation

In the given example,

N = 4.So, the output should be


* * * *

* *

* *

* * * *

*

*

* * * *


Sample Input 1

4

Sample Output 1

* * * *

* *

* *

* * * *

*

*

* * * *

Sample Input 2

5

Sample Output 2

* * * * *

* *

* *

* *

* * * * *

*

*

*

* * * * *




The media company "GlobalAd" has received a
batch of advertisements from different product
brands. The batch of advertisements is a
numeric value where each digit represents the
number of advertisements the media company
has received from different product brands.
Since the company banners permit only even
numbers of advertisements to be displayed, the
media company needs to know the total
number of advertisements it will be able to
display from the given batch.
Write an algorithm to calculate the total
number of advertisements that will be
displayed from the batch.
Input
The input consists of an integer batch,
representing the batch of advertisements
Output
Print an integer representing the total number
of advertisements that will be displayed by the
media company
Constraints
0 < batchs 109​

for this inputs

5

0 -2

3 6

4 7

1 -3

2 -1

5

0 1

1 2

2 -4

3 3

4 5

expected output is

12x^4 + 9x^3 - 5x^2 - x - 1

but output is

12x^4 + 9x^3 - 5x^2 - 1x - 1

for question #206080



Q3. A customer getting offers from different banks for deposit amount. From SBI customer is getting offer for 7.5 rate of interest , from PNB Bank getting offer for 8.5 rate of interest and from OBC Bank getting offer 9.5 rate of interest. Create an application where you have to create one base class named "ReserveBank" which has given instructions to all bank to give some rate of interest in deposit amount. Find out the amount after applying rate of interest from all these banks.


write a program to get given output for the given input.

input:[[1,2,3],[2],[3,4],[1,2,5,6],[5,7,8]]

output:[1,2,3,4,5,6,7,8]

in python.


Suppose there is XYZ Company and there are different departments like: production, marketing, finance, sales etc. Manager of the company want to know about the detail of the employees who are highly paid from each department. Write a program using the concept of classes to implement the same.
Write a program to print the right alphabetic triangle up to the given N row
Given a M x N matrix, write a program to print all Anti-Diagonals elements of matrix
LATEST TUTORIALS
APPROVED BY CLIENTS