You are given a string S as input, write a program to print the string after reversing the words of the given sentence.
Input
The first line of input is a string S.
Explanation
In the given example, the sentence This is Python contains 3 words. When reversing, the word Python comes to the starting of the sentence, and This goes to the last of the sentence. The word is remains in the same position.
So the output should be Python is This.
Sample Input 1
This is Python
Sample Output 1
Python is This
Sample Input 2
Hi! World Hello
Sample Output 2
Hello World Hi!
Trapezium Order
you are given an integer N . print N rows starting from 1 in the trapexium order as shown in the output of the below examples .
Input
the input contains an integer N
OUTPUT
the output should have N lines
each of the N lines should have space -seperated integers as per the trapezium order
CHECK THE LINK BELOW FOR EXACT OUTPUT
https://docs.google.com/document/d/1rMdPEY_1fttuydfFQLeJHmX_eMa66awj84hW2pnAdyI/edit
note : in the output second row 2 below there should be 5 and 3 below there should be 6 and likewise respected third row there should be 6 below there should be 8 and so on
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