You are given an array A consisting of N integers.
Task
Print the sum of the elements in the array.
Note: Some of the integers may be quite large.
Input Format
Output format
Print a single value representing the sum of the elements in the array.
Constraints
1<=N<=10
0<=a[i]<=10^10
Write a program that lets user enter in a potentially unlimited series of subject marks from 0 to 100. Ensure that the numbers entered are greater than 0 and less than 100. You cannot assume that the user will enter an integer or a float. User can enter both float and integer values. If they input a negative number or a number more than hundred you should continually prompt them to enter a valid number until they do so. When the user enters a the line ”end” you should stop collecting marks.
Then use their input to generate a summary report that includes Total marks, Average mark, Highest mark and the lowest mark. Sample output is given below.
Enter a mark, 0 to 100: apple
That's not a valid mark!
Enter a price, 0 to end: -5
Marks must be positive!
Enter a mark, 0 to 100: 10
Enter a mark, 0 to 100: 20
Enter a mark, 0 to 100: 30
Enter a mark, 0 to 100: 40
Enter a mark, 0 to 100: 50
Enter a mark, 0 to 100: end
Total marks: 150.0
Average marks: 30.0
Highest mark: 50.0
Lowest mark: 10.0
Please refer new input and output given below, please include the solution
Area of Square
Given an MxN matrix filled with
The first line of input will be containing two space-separated integers, denoting M and N.
The next M lines will contain N space-separated integers, denoting the elements of the matrix.
Input:
3 6
O X X X X X
O X X X X X
O X X X X X
Expected Ouput: 9
Hi, Please refer new input and output as given below. include new input also
Add two polynomials
Given two polynomials A and B, write a program that adds the given two polynomials A and B.
Input
The first line contains a single integer M.
Next M lines contain two integers Pi, Ci separated with space, where Pi denotes power and Ci denotes co-efficient of Pi for polynomial A.
After that next line contains a single integer N.
Next N lines contain two integers Pj, Cj separated with space, where Pj denotes power and Cj denotes co-efficient of Pj for polynomial B.
Output
Given Input:
4
0 5
1 0
2 10
3 6
4
0 -5
1 0
2 -10
3 -6
Expected Output: 0
Elle Joy Vasquez 2
Create a Python script that will display the next 5 numbers in the sequence where each number is the sum of the previous two.
TEXT FILE
8 3
4 5
6 2
Output
8 3 11 14 25 39 64
4 5 9 14 23 37 50
6 2 8 10 18 28 46
Elle Joy Vasquez 1
Create a Python script that will display the SUM of all even and the SUM of all odd numbers in a text file.
TEXT FILE
20
4
15
30
5
OUTPUT
SUM OF EVEN: 54
SUM ODD: 20
Write a python program for check the given digit is repeated how many times in the given number
Create a program that will accept two numbers and print the product, quotient, sum, difference, remainder, exponent and floor division. First number will be the left operand for quotient, difference, remainder, exponent, and floor division. Also, it prints "True" if it satisfies the condition and "False" otherwise: First number is within 10 and 20
Second number is within 10 and 20
Add two polynomials
Given two polynomials A and B, write a program that adds the given two polynomials A and B
For term Cix^Pi, if the coefficient of the term Ci is 1, simply print x^Pi instead of 1x^Pi.
If the degree of the polynomial is zero and the constant term is also zero, then just print 0 to represent the polynomial.
Sample Input
4
0 5
1 0
2 10
3 6
3
0 1
1 2
2 4
Sample Output
12x^4 + 9x^3 - 5x^2 - x - 1
Take two lists from the user (elements of the lists
separated by space) of
the same size. The first list will contain some names and the second list
will contain roll numbers. Your job is to assign each name
a roll number
from the list containing numbers following the criteria
given below:
Find the sum of the ASCII value of each name and then sort
the names in
descending order based on the sum. Then assign
lowest number to the
the
name that has the highest ASCII value sum as a roll number.
Sample Input 1:
Alan Jack Nancy Jim
10 15 20 50
Sample Output 1:
Nancy's roll number is: 10
Alan's roll number is: 15
Jack's roll number is: 20
Jim's roll number is: 50