Maximum
You are given N number of inputs. Print the maximum of them after each input.
Input
The first line of input is an integer N. The next N lines each contain an integer as input.
Explanation
In the example, you are given
6 inputs 1, 0, 3, 2, 9, 8.
1 is maximum in the input 1.
1 is maximum in the input 1, 0.
3 is maximum in the input 1, 0, 3.
3 is maximum in the input 1, 0, 3, 2.
9 is maximum in the input 1, 0, 3, 2, 9.
9 is maximum in the input 1, 0, 3, 2, 9, 8.
So, the output should be
1
3
3
9
9
Sample Input 1
6
1
3
2
9
8
Sample Output 1
1
1
3
3
9
9
Sample Input 2
5
1
2
3
4
5
Sample Output 2
1
2
3
4
5
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
You are given a square matrix A of dimensions NxN. You need to apply the below given 3 operations on the matrix A.
Rotation: It is represented as R S where S is an integer in {90, 180, 270, 360, 450, ...} which denotes the number of degrees to rotate. You need to rotate the matrix A by angle S in the clockwise direction. The angle of rotation(S) will always be in multiples of 90 degrees.
Update: It is represented as U X Y Z. In initial matrix A (as given in input), you need to update the element at row index X and column index Y with value Z.
After the update, all the previous rotation operations have to be applied to the updated initial matrix.
Querying: It is represented as Q K L. You need to print the value at row index K and column index L of the matrix A.
Use the nested list to maintain the matrix.
Use indexing to get the operation.
You can iterate over the matrix or use indexing appropriately to perform appropriate operations.
The order in which you ask the user for the words matters and needs to match the s
Let's play Silly Sentences!
Enter a name: Grace
Enter an adjective: stinky
Enter an adjective: blue
Enter an adverb: quietly
Enter a food: soup
Enter another food: bananas
Enter a noun: button
Enter a place: Paris
Enter a verb: jump
Grace was planning a dream vacation to Paris.
Grace was especially looking forward to trying the local
cuisine, including stinky soup and bananas.
Grace will have to practice the language quietly to
make it easier to jump with people.
Grace has a long list of sights to see, including the
button museum and the blue park.Let's play Silly Sentences!
[name] was planning a dream vacation to [place].
[name] was especially looking forward to trying the local
cuisine, including [adjective 1] [food 1] and [food 2].
[name] will have to practice the language [adverb] to
make it easier to [verb] with people.
[name] has a long list of sights to see, including the
[noun] museum and the [adjective 2] parkwants to buy a necklace in which
1. There is a minimum of 1 pearl and maximum of X pearls, such that each pearl
has its own magnificent coefficient.
2. The pearls should be in non-decreasing order of their magnificence power
You are given the maximum number of pearls in a necklace and the range of the magnificent coefficients of the pearls Find the number of necklaces that can be made that follow the mentioned conditions
Input Specificatione
input1: Maximum number of pearls that can be used to form the necklace
input2: Starting magniliomt coefficient of pearls
input3: Ending magnificent coefficient of pearls
Output Specification
Retum the number of necklace options possible as per given conditions
Add two polynomials: Given two polynomials A and B, write a program that adds the given two polynomials A and B.
input: output:0
4
0 5
1 0
2 10
3 6
4
0 -5
1 0
2 -10
3 -6
class PriceChecker():
def __init__(self):
self.levelsList = []
self.currentPrice = 0.0
self.BitmexClient = bitmex.bitmex(test=False)
@property
def levelsList(self):
return self.__levelsList
@levelsList.setter
def levelsList(self, newValue):
self.__levelsList = newValue
@property
def currentPrice(self):
...
@currentPrice.setter
def currentPrice(self, newValue):
...
# Function: Display the Bitcoin price in the menu item – to assist the user when setting price levels
def updateMenuPrice(self):
# Get the latest Bitcoin info (as a Tick object) from getBitMexPrice(). Name it tickObj.
tickObj = self.getBitMexPrice()
# Update the currentPrice property with the Bitcoin price in tickObj.
. . .
@property
def currentPrice(self):
. . . # Return the value of __currentPrice
@currentPrice.setter
def currentPrice(self, newValue):
. . . # Set the value of __currentPrice