Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

 ('')

 ( (

  ) )

 ( (

  ) )

 ( (

  ) )

 ( (

  ) )

   V


 ('')

 ( (

  ) )

 ( (

  ) )

 ( (

  ) )

 ( (

  ) )

   V


Part 3

Describe your experience so far with peer assessment of Programming Assignments.

How do you feel about the aspect assessments and feedback you have received from your peers?
How do you think your peers feel about the aspect assessments and feedback you provided them?
Part 2

Provide your own examples of the following using Python lists. Create your own examples. Do not copy them from another source.

Nested lists
The “*” operator
List slices
The “+=” operator
A list filter
A list operation that is legal but does the "wrong" thing, not what the programmer expects
Provide the Python code and output for your program and all your examples
Part 1

Write a Python program that does the following.

Create a string that is a long series of words separated by spaces. The string is your own creative choice. It can be names, favorite foods, animals, anything. Just make it up yourself. Do not copy the string from another source.

Turn the string into a list of words using split.

Delete three words from the list, but delete each one using a different kind of Python operation.

Sort the list.

Add new words to the list (three or more) using three different kinds of Python operation.

Turn the list of words back into a single string using join.

Print the string.
Describe the difference between objects and values using the terms “equivalent” and “identical”. Illustrate the difference using your own examples with Python lists and the “is” operator.

Describe the relationship between objects, references, and aliasing. Again, create your own examples with Python lists.

Finally, create your own example of a function that modifies a list passed in as an argument. Describe what your function does in terms of arguments, parameters, objects, and references.

Create your own unique examples for this assignment. Do not copy them from the textbook or any other source.
Remove excess spaces from the given text, ie leave only one of several spaces
#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:





LATEST TUTORIALS
APPROVED BY CLIENTS