Given an integer
N as input, write a program to print a number diamond of 2*N -1 rows as shown below.
Note: There is a space after each number.
Write a program to count Vowels and Consonants in string.
Replacing Characters of Sentence
You are given a string
S. Write a program to replace each letter of the string with the next letter that comes in the English alphabet.
Note: Ensure that while replacing the letters, uppercase should be replaced with uppercase letters, and lowercase should be replaced with lowercase letters.
The first line of input is a string.
In the given example, Hello World.
If we replace each letter with the letter that comes next in the English alphabet,
H becomes I, e becomes f and so on ... So, the output should be Ifmmp Xpsme.
Sample Input 1
Hello World
Sample Output 1
Ifmmp Xpsme
Sample Input 2
Something is better than Nothing
Sample Output 2
Tpnfuijoh jt cfuufs uibo Opuijoh
Roots of a quadratic equation
You are given coefficients a, b and c of a quadratic equation ax2 + bx + c = 0. Find the roots r1, r2 of the equation.
Note:
The first line of input is an integer a. The second line of input is an integer b. The third line of input is an integer c.
In the given example, a = 1, b = -5, c = 6. Then the equation is x2 - 5x + 6 = 0
r1 = (-b + (b^2 - 4*a*c)^0.5)/2*a
r1 = (5 + (25 - 24))/2
r1 = 3
and
r2 = (-b - (b^2 - 4*a*c)^0.5)/2*a
r2 = (5 - (25 - 24))/2
r2 = 2
So, the output should be
3
2
Sample Input 1
1
-5
6
Sample Output 1
3.0
2.0
Sample Input 2
-1
1
6
Sample Output 2
-2.0
3.0
Acronyms
This Program name is Acronyms. Write a Python program to Acronyms, it has two test cases
The below link contains Acronyms question, explanation and test cases
https://docs.google.com/document/d/1tb9wBreT7FpfJwKOEYgFoR1RX-WY7KuD/edit?usp=sharing&ouid=104486799211107564921&rtpof=true&sd=true
We need exact output when the code was run
Average of Given Numbers
This Program name is Average of Given Numbers. Write a Python program to Average of Given Numbers, it has two test cases
The below link contains Average of Given Numbers question, explanation and test cases
https://docs.google.com/document/d/1N0TJ_dtyZN-TJW6P6KfFmqNc-qQhOVOu/edit?usp=sharing&ouid=104486799211107564921&rtpof=true&sd=true
We need exact output when the code was run
Largest Number in the List
This Program name is Largest Number in the List. Write a Python program to Largest Number in the List, it has two test cases
The below link contains Largest Number in the List question, explanation and test cases
https://docs.google.com/document/d/120K51mYmZkwWPZ-KiP4VWxPG52b8P7tB/edit?usp=sharing&ouid=104486799211107564921&rtpof=true&sd=true
We need exact output when the code was run
Product of Elements in the List
This Program name is Product of Elements in the List. Write a Python program to Product of Elements in the List*, it has two test cases
The below link contains Product of Elements in the List question, explanation and test cases
https://docs.google.com/document/d/1z9x8MrBxQdl0oiXfsRD5ZjEi0UTqnVrg/edit?usp=sharing&ouid=104486799211107564921&rtpof=true&sd=true
We need exact output when the code was run
Reverse the Sentence
This Program name is Reverse the Sentence. Write a Python program to Reverse the Sentence, it has two test cases
The below link contains Reverse the Sentence question, explanation and test cases
https://docs.google.com/document/d/1LuMChyEPcL8qBRrDAap5By4hclNuodwH/edit?usp=sharing&ouid=104486799211107564921&rtpof=true&sd=true
We need exact output when the code was run
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 . . . .
. . . 0 0 0 . . .
. . 0 0 0 0 0 . .
. 0 0 0 0 0 0 0 .
0 0 0 0 0 0 0 0 0
. 0 0 0 0 0 0 0 .
. . 0 0 0 0 0 . .
. . . 0 0 0 . . .
. . . . 0 . . . .
Sample Input 1
5
Sample Output 1
. . . . 0 . . . .
. . . 0 0 0 . . .
. . 0 0 0 0 0 . .
. 0 0 0 0 0 0 0 .
0 0 0 0 0 0 0 0 0
. 0 0 0 0 0 0 0 .
. . 0 0 0 0 0 . .
. . . 0 0 0 . . .
. . . . 0 . . . .
Sample Input 2
4
Sample Output 2
. . . 0 . . .
. . 0 0 0 . .
. 0 0 0 0 0 .
0 0 0 0 0 0 0
. 0 0 0 0 0 .
. . 0 0 0 . .
. . . 0 . . .