•Write a program that asks the user to enter the string using getline function. It then calculates the number of vowels and the number of consonants in the string
–Hint :Remember that spaces or other non alpha characters should be ignored
–Any function that does it?
Triplet Sum
Write a Python Program for Triplet Sum
The below link contains Triplet Sum Question and test cases
https://drive.google.com/file/d/1kPR1eOaf9JTOqqAj4w_A4e8Nc0jIa3fM/view?usp=sharing
Triplet Sum
Given an array n integers, find and print all the unique triplets (a, b, c) in the array which give the sum K. (a+b+c=K).
Input
The first line of the input will be space separated integers, denoting the elements of the array. The second line of the input will be an integer denoting the required sum K
Output
The output should be multiple lines, each line containing a unique triplet. The elements of the triple must be sorted in increasing order and all the triplets printed must be sorted in increasing order. Print "No Matching Triplets Found" if there are no triplets with the given sum.
Test Case 1
Input
0 12 17 8 9 21
29
Output
(0, 8, 21)
(0, 12, 17)
(8, 9, 12)
Test Case 2
Input
0 1 2 3 5 7 13 17 19 19
22
Output
(0, 3, 19)
(0, 5, 17)
(1, 2, 19)
(2, 3, 17)
(2, 7, 13)
We need all two test cases can be came when code was run. I want exact outputs for all test cases
Non-Adjacent Combinations of Two Words
Write a Python Program of Non-Adjacent Combinations of Two Words
The above link contains Question and test cases
https://drive.google.com/file/d/1BAzikXzPal2JOSNLSXuxx2lASwEb-cpF/view?usp=sharing
We need all test cases can be came when code was run. I want exact outputs for all test cases
Non-Adjacent Combinations of Two Words
Given a sentence as input, find all the unique combinations of two words and print the word combinations that are not adjacent in the original sentence in lexicographical order.
Output
The output should be multiple lines, each line containing a valid unique combination of two words. The words in each line should be lexicographical order and the lines as well should be in lexicographical order. A valid combination will not contain the words that appear adjacent in the given sentence. Print "No Combinations" if there are no valid combinations.
Test case 1
Input
raju always plays cricket
Output
always cricket
cricket raju
plays raju
Test case 2
Input
python is a programming language
Output
a language
a python
is language
is programming
language python
programming python
Test case3
Input
to be or not to be
Output
be be
be not
or to
to to
We need all three test cases can be came when code was run. I want exact outputs for all test cases
Identify that may be a physical Constraints that the technology is likely to face and what you would recommend about that
Rotate Matrix Rings
Given a matrix of order M*N and a value K, write a program to rotate each ring of the matrix clockwise by K elements. If in any ring has less than or equal to K elements, then don’t rotate that ring.
Input
The first line of input will be two space-separated integers, denoting the M and N.
The next M lines will contain N space-separated integers.
The next line will contain an integer, denoting K.
Output
The output should be M*N matrix by rotating the matrix by K elements.Explanation
Test case 1
Input:-
4 4
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
3
Output:-
13 9 5 1
14 7 11 2
15 6 10 3
16 12 8 4
Test case 2
Input:-
3 4
1 2 3 4
10 11 12 5
9 8 7 6
2
Output:-
9 10 1 2
8 11 12 3
7 6 5 4
We need all test cases can be came when code was run. I want exact outputs for all test cases
Please arrang the program below. I indicate the sample and output of the program
n = int(input())
for i in range(n):
lst = list(map(int,input().split()))
lst1 = lst[1:]
elem = lst1[0]
counter= 1
for j in range (1,len(lst1)):
if 2*elem > lst1[j]:
counter = 0
break
elem = lst1[j]
if(counter == 1):
print("Denominations: ",lst1)
print("Good coin denominations !")
else:
print("Denominations: ",lst1)
print("Bad coin denominations !")
Sample input:
2
4 1 5 10 25
3 1 5 6
Ouput:
Denominations: [1, 5, 6, 25]
Good coin denominations!
Denominations: [1,5,6]
Bad coin denominations!
print the combinations of words in lexicogarphical order which are not adjacent in the given input sentence