Farmer Brown
Leg_number = chickens*2 + cows*4 + bees*6
A farmer has chickens with 2 legs, cows with 4 legs, and bees with 6 legs on his farm. Write a program that, given the number of chickens, cows and bees, will output the total number of legs
Determinant
Given as input 4 space-separated integers a b c d, write a program to output the value ad – bc. The value of each integer is between - 10000 and 10000
Compound interest
Take in the principle amount interest as % and duration of the investment in years return the accumulated amount
Simple interest
Take in the principle amount interest as % and duration of the investment in years return the accumulated amount
you will load the training and test sentiment datasets "twitdata_TEST.tsv" and "allTrainingData.tsv". The data should be loaded into 4 lists of strings: X_txt_train, X_txt_test, y_test, y_train.
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