SWAP CASE:
Explantion:
In the first example S=abc and T=acb.Arjun can swap the 2nd and 3rd characters of S to make S and T equal.Hence ,the output is Yes
i/p:
abc
acb
o/p:Yes
Find the password:
Joey is planning escape room and to exit the room he has to find the password for the final door .To know the password he is given a sentence G and told to rearrange the sentence by rotating it's w words in the right.Can you help joey find the password
input:
The input is a string G
The second line input is integer w
i/p:
Raju is going to school
3
o/p:
going to school Raju is
i/p: Trapezium order pattern
1
o/p: pattern Trapezium order
CONCATENATION GAME:
Sameer is playing a game. To win that game he has to combine the list of strings vertically(column wise) and present the final answer in that pattern.
input:
The first line of input contains an integer N that denotes the number of lists to combine
Each of the next N lines of the input contains strings separated by space.
i/p:
1
Hy
o/p:Hy
i/p:
2
by by
hy hy
o/p:
byhy
byhy
i/p:2
by hy
hy
o/p:
byhy
hy
i/p:3
Not you kid
They are got
Like great
o/p:
NotTheyLike
youaregreat
kidgot
SUM OF POWERS:
you are given a list of integers L of size N. write a program to compute the value of SUM
SUM=x1pow1+x2pow2+x3pow3+-----+xNpowN
where xi concatenated with powi is the i th element of the list L and powj is single digit number
input:
The input contains space-separated N integers
Explanation: L=[25]
x1=2 ,pow1=5
SUM=2^5=32
i/p: L=[132,301]
x1=13,pow1=2
x2=30,pow2=1
SUM=13^2 +30^1=199
i/p:25
o/p:32
i/p:132 301
o/p:199
Maximum Number of Books:
There are multiple(T)book stores in the area each shopkeeper has a list of B integers that represents the cost of each book you have different pocket money(p) for each book store. write a program to calculate the maximum number of books you can buy in each store with the corresponding packet money.
input:
The first line of input is a positive integer T that represents the number of shops.
The following lines represent the details of the T shops.
Each set of two consecutive lines represents the details of a shop.
The first line of each set contains two space-seperated integers B & P
The second line of each set contains B space-seperated integers.
input:
3
6 100
20 40 10 80 20 10
4 70
20 10 300 30
4 200
220 1000 500 2000
output:
5
3
input:
2
8 250
2070 1350 365 2750 30 20 140 240
4 500
1070 2893 2200 39
output:
3
1
Math Quiz:
The first line input space-seperated integers.
the second line input is positive integer M denoting the number of index ranges
The next M lines contains two space-seperated integers of the range.
explanation: 1 2 2 3 3 3 4 5 6
2
0 2
1 4
output:
1+2+2=5
1+2+2+3+3+3+4=18
input:
1 2 2 3 3 3 4 5 6
2
0 2
1 4
output:
5
18
input:6 6 14 20 8 -2 2 -3
4
1 2
2 5
3 6
0 4
output:
2
2
12
2
1-Choose your types of list as follows: Plants, Animals, Cities,
Countries, Football Teams, Classmates, Customers, Chemical elements, etc.
2-Draw flow chart and write python program in according to
following instruction:
*Add elements to your list.
*Remove element from tour list.
*Edit element on your list.
*Sort your elements.
*Print one element from your list.
*Print all of the elements from
your list.
Add two polynomials:
Given two polynomials A and B, write a program that adds the given two polynomials A and B.
Output:
Print the addition of polynomials A and B.
The format for printing polynomials is: Cix^Pi +Ci-1x*Pi-1t +C1x + CO, where Pi's are powers in decreasing order, Ci is co-efficient and CO is constant, there will be space before and after the plus or minus sign.If co-efficient is zero then don't print the term.If the term with highest degree is negative, the term should be represented as -Cix^Pi.For the term where power is 1 represent it as C1x instead of C1x^1.
If the degree of polynomial is zero and the
constant term is also zero, then just print 0 to represent the polynomial.
For term Cix°Pi, if the coefficient of the term CI is 1, simply print x*Pi instead of 1x^Pi.
Sample Input
4
05
10
2 10
3 6
3
01
12
24
Sample Output
6x3 + 14x^2 +2x + 6
O
Create a program with two methods, one method for displaying your full name and the
other method displays your address.
I am Carla May Laput and my address is 067, Purok Bougainvilla, Larayan Dapitan City 7101
Create a program that contains two methods, one for displaying all even numbers from 1
to 10 and the other one displays all odd numbers from 1-10.