String Concatenation
Disha has three strings A, B, and C consisting of lowercase letters.She also has a string T consisting only of characters 1, 2 and 3.
She wants to concatenate the three strings according to the characters in T.
Your task is to print the final output string.
Note: Formally, follow the below instructions:
* For each integer i such that 1<=i<=|T|, let the string si be defined as follows:
*Concatenate the strings s1,s2,...,s|T| in this order and print the resulting string.
Sample Input1
mari
to
zzo
1321
Sample Output1
marizzotomari
Number Game
A group of people are playing a game.They are standing and each carring a card with a number on it.These numbers in the list A. A random number S iis selected.
Find out the new list of numbers after
Sample Input1
1,2,3
1
Sample Output1
2 3
1 2
Word Rotation
Given a sentence and an integer N, write a program to rotate letters of the sentence among the words without changing the length of those words and positions of the spaces.
Input
The first line of input will be a sentence.
The second line of input will be an integer N.
Output
The output should be a single line containing the sentence by rotating the letters among the words without changing the length of the words and positions of the spaces.
Explanation
For example, if the given sentence and N are
Welcome to your first problem
5
Rotate the sentence 5 letters towards right side without changing the length of the words and position of spaces in the original sentence.
So the output should be
oblemWe lc omet oyour firstpr
Sample Input 1
Welcome to your first problem
5
Sample Output 1
oblemWe lc omet oyour firstpr
Sample Input 2
All the best
2
Sample Output 2
stA llt hebe
Purchase List
At a shop, a shopkeeper is making a note of all the purchases at the end of the day.He has a list full of the purchases that happened at the shop.He wants to know which item got sold only once and which item got sold more than once.Print their prices as asked.
Note:In case of ties, choose the price of the item that was sold earlier in the day.
Input
The input is a single line containing space-separated integers representing the prices of the purchases.
Output
The first line of the output contains an integer that represents the price of an item that is sold only once.
The second line of the output contains an integer that represents the price of an item that is sold more than once.
If there is no filling the given criteria, print None.
Sample Input1
5 5 4 7 4 1 11
Sample Output1
7
5
Sample Input2
1 2 3 4 5 6 7 8 9
Sample Output2
1
None
Math Quiz
Write a python program to print the following,
Sample Input 1
1 3 4 5 6
5
3 5
Sample Output1
12
String Lookup
Ram challenges Anil to a game, He decides to give a target word W to Anil.The rules of the game are very simple.Ram gives Anil N sentences one by one and asks Anil to print the first sentence which contains the given word W.If the sentence numbering starts from 1, can you identify the first sentence number containing the word W?
Note: Consider lower and upper case letters as different.
Input
The first line of input is the word W.
The second line of input is a positive integer N.
The next N lines of input contain a string in each line.
Output
The output should be a single line containing an integer.
If the given word is not in any line of input strings, print -1.
Write the Python code of a program that reads an integer, and prints the integer it is a multiple of either 2 or 5 but not both. If the number is a multiple of 2 and 5 both, then print "Multiple of 2 and 5 both
write a python function which take list A as input and return five lists, one contains all prime numbers in A, second one contains composite numbers in A, the third list contains all numbers in A which are neither divisible by 2, fourth and fifth list contains number divisible by 3 and 5 respectively.
write a program to print of sum of two number a and b if there sum is less than two otherwise print the product of number
Create a Python script that will compute the NET Salary of an employee from an input number of hours worked and the rate per hour. An additional 20% of the overtime pay if an employee worked for more than 40 hours of regular work.
Sample Output:
Hours Worked : 45
Rate (per Hour): 200
Basic Pay : 8000
Overtime Pay : 1000
Incentive : 200
NET Salary is 9200
I need the code to have an output as stated above.