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

Given

N = 10From 1 to 9, each number contains a single digit. From 10 onwards, the numbers contain two digits.

So the output should be 9 + 2 =

11.

Sample Input 1

10

Sample Output 1

11

Sample Input 2

4

Sample Output

4


Write following functions and demonstrate their working using a program.
1- Sum Function (takes two integer parameters and returns their sum)
2- Difference Function (takes two integer parameters and returns their difference)
3- Product Function (takes two integer parameters, performs division, returns product)
4- Quotient Function (takes two integer parameters, performs division, returns quotient)
5- Remainder Function (takes two integer parameters, performs division and returns remainder)

Is that provided code implemented with all the functionalities given in question?.I think,last 2 functionalities are not implemented in the code...can you please confirm back to me.

Thanks,



Write a function which takes two integers as parameter and return the largest number. Demonstrate the function using a program (call that function). Display the largest number in main function


In a right triangle, the square of the length of one side is equal to the sum of the squares of the lengths of the other
two sides. Write a program that prompts the user to enter the lengths of three sides of a triangle and then outputs a message
indicating whether the triangle is a right triangle.

Write a program to print the anti-diagonal elements in the given matrix.

Input

The first line of input will contain an integer N, denoting the number of rows and columns of the input matrix.

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

Output

The output should be a list containing the anti-diagonal elements.

Explanation

For example, if the given N is 3, and the given matrix is

1 2 3

4 5 6

7 8 9

The anti diagonal elements of the above matrix are 3, 5, 7. So the output should be the list

[3, 5, 7]

Sample Input 1

3

1 2 3

4 5 6

7 8 9

Sample Output 1

[3, 5, 7]

Sample Input 2

5

44 71 46 2 15

97 21 41 69 18

78 62 77 46 63

16 92 86 21 52

71 90 86 17 96

Sample Output 2

[15, 69, 77, 92, 71]


Given a list of integers, write a program to identify the contiguous sub-list that has the largest sum and print the sum. Any non-empty slice of the list with step size 1 can be considered as a contiguous sub-list.

Input


The input will contain space-separated integers, denoting the elements of the list.

Output


The output should be an integer.

Explanation


For example, if the given list is [2, -4, 5, -1, 2, -3], then all the possible contiguous sub-lists will be,


[2]

[2, -4]

[2, -4, 5]

[2, -4, 5, -1]

[2, -4, 5, -1, 2]

[-4]

[-4, 5]

[-4, 5, -1]

[-4, 5, -1, 2]

[5]

[5, -1]

[5, -1, 2]

[-1]

[-1, 2]

[2]

Among the above contiguous sub-lists, the contiguous sub-list [5, -1, 2] has the largest sum which is 6.

Sample Input 1

2 -4 5 -1 2 -3

Sample Output 1

6


Sample Input 2

-2 -3 4 -1 -2 1 5 -3

Sample Output 2

7




Given a list of integers, write a program to identify the contiguous sub-list that has the largest sum and print the sum. Any non-empty slice of the list with step size 1 can be considered as a contiguous sub-list.

Input


The input will contain space-separated integers, denoting the elements of the list.

Output


The output should be an integer.

Explanation


For example, if the given list is [2, -4, 5, -1, 2, -3], then all the possible contiguous sub-lists will be,


[2]

[2, -4]

[2, -4, 5]

[2, -4, 5, -1]

[2, -4, 5, -1, 2]

[-4]

[-4, 5]

[-4, 5, -1]

[-4, 5, -1, 2]

[5]

[5, -1]

[5, -1, 2]

[-1]

[-1, 2]

[2]

Among the above contiguous sub-lists, the contiguous sub-list [5, -1, 2] has the largest sum which is 6.

Sample Input 1

2 -4 5 -1 2 -3

Sample Output 1

6


Sample Input 2

-2 -3 4 -1 -2 1 5 -3

Sample Output 2

7




Compare last three characters
Explanation given strings are apple,pimple in both the strings the last three characters ple are comman

CS Python Fundamentals Assignment 1: Silly Sentences


LATEST TUTORIALS
APPROVED BY CLIENTS