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

Give a string writen a program to return the sum and average of the number that appear in the string igonring all other characters
Give two strings write a program to determine if a string S2 is a rotation of another string S2
You should submit a script file and a plain text output file (.txt) that contains the test output. Multiple file uploads are permitted. Don’t forget to include descriptive comments in your Python code.

Your submission will be assessed using the following Aspects.

Does the submission include the is_divisible function from Section 6.4 of the textbook?
Does the submission implement an is_power function that takes two arguments?
Does the is_power function call is_divisible?
Does the is_power function call itself recursively?
Does the is_power function include code for the base case of the two arguments being equal?
Does the is_power function include code for the base case of the second argument being "1"?
Does the submission include correct output for the five test cases?
Do Exercise 6.4 from your textbook using recursion and the is_divisible function from Section 6.4. Your program may assume that both arguments to is_power are positive integers. Note that every positive integer that has an exponent of 0 is a power of "1". This includes "0" and "1", itself.

After writing your is_power function, include the following test cases in your script to exercise the function and print the results:

print("is_power(10, 2) returns: ", is_power(10, 2))
print("is_power(27, 3) returns: ", is_power(27, 3))
print("is_power(1, 1) returns: ", is_power(1, 1))
print("is_power(10, 1) returns: ", is_power(10, 1))
print("is_power(3, 3) returns: ", is_power(3, 3))

Write an algorithm to find the ERG character for a given employee's ERP


Armstrong numbers between two intervals
Write a program to print all the Armstrong numbers in the given range A to B(including A and B). An N-digit number is an Armstrong number if the number equals the sum of the Nth power of its digits.

Input
The first line has an integer A.
The second line has an integer B.

Output
Print all Armstrong numbers separated by a space.
If there are no Armstrong numbers in the given range, print -1.

Explanation
For A = 150 and B = 200

For example, if we take number 153, the sum of the cube of digits 1, 5, 3 is

13 + 53 + 33 = 153.

So, the output should be 153.

Sample Input 1
150
200
Sample Output 1
153
Sample Input 2
1
3
Sample Output 2
1 2 3

write a python program to replicate this for the n*n matrix

expected output:

enter the matrix and no of tasks: 3 2

intial matrix ([0 0 0] [0 0 0] [0 0 0])

task1: row and column 2 2

[[0 1 0] [1 1 1] [0 1 0]]

['0,0', '0,2', '2,0','2,2'] count 4

task2: row and column 1 1

[[1 1 1] [1 1 1] [1 1 0]]

['2,2'] count:1

Ans:['4','1']


Shaded Diamond

Given an integer value

N as input, write a program to print a shaded diamond of 2*N -1 rows using an asterisk(*) character 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 = 5. Therefore, the output should be

*

* *

* * *

* * * *

* * * * *

* *

* *

* *

*


Sample Input 1

6

Sample Output 1

*

* *

* * *

* * * *

* * * * *

* * * * * *

* *

* *

* *

* *

*

Sample Input 2

5

Sample


Armstrong numbers between two intervals

Write a program to print all the Armstrong numbers in the given range

A to B(including A and B). An N-digit number is an Armstrong number if the number equals the sum of the Nth power of its digits.Input

The first line has an integer

A. The second line has an integer B.Output

Print all Armstrong numbers separated by a space.

If there are no Armstrong numbers in the given range, print -1.

Explanation

For

A = 150 and B = 200For example, if we take number 153, the sum of the cube of digits

1, 5, 3 is 13 + 53 + 33 = 153.

So, the output should be

153.

Sample Input 1

150

200

Sample Output 1

153

Sample Input 2

1

3

Sample Output 2

1 2 3



Give two integers M and N write a program to print the first perfect square in a given range
LATEST TUTORIALS
APPROVED BY CLIENTS