('')
( (
) )
( (
) )
( (
) )
( (
) )
V
('')
( (
) )
( (
) )
( (
) )
( (
) )
V
#loop through displayList
for i in range(0,len(displayList)):
#Test if the fist item in the current sub-list contains the text "Price Level
#Tip: Remeber that each sub-list is a (displayList). So you have
# to access its items via displayList followed by TWO indexes.
if i[0] == 'priceLevel':
#Extract the second item from the current sub-list into variable called priceLevel
priceLevel = i[1]
#Test if priceLevel is between pPrice and cPrice OR
#priceLevel == pPrice OR
# priceLevel == cPrice
if priceLevel >= self.__previousPrice and priceLevel <= self.__currentPrice or priceLevel == self.__previousPrice or priceLevel == self.__currentPrice:
#Sound the alarm. Pass in the frequency and duration.
if self.__currentPrice > self.__previousPrice:
frequency = 800
duration = 700
else:
frequency = 400
duration = 700
winsound.Beep(frequency, duration)
#Print the text 'Alarm' with a green background color, so that the user
#can go back and check when the alarm was sounded.
print(Back.GREEN + "Alarm" + Style.RESET_ALL)An ecommerce company plans to given their customer special discount .sum of all prime digits of total bill
Rearrange Numbers in String
Given a string, write a program to re-arrange all the numbers appearing in the string in decreasing order. Note: There will not be any negative numbers or numbers with decimal part.
Input
The input will be a single line containing a string.
Output
The output should be a single line containing the modified string with all the numbers in string re-ordered in decreasing order.
Explanation
For example, if the given string is "I am 5 years and 11 months old", the numbers are 5, 11. Your code should print the sentence after re-ordering the numbers as "I am 11 years and 5 months old".
Sample Input 1:
I am 5 years and 11 months old
Sample Output 1:
I am 11 years and 5 months old
Sample Input 2:
I am -5 years and 11.0 old
Sample Output 2: