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

("Debugging") lists three possibilities to consider if a function is not working.

Describe each possibility in your own words.

Define "precondition" and "post condition" as part of your description.

Create your own example of each possibility in Python code. List the code for each example, along with sample output from trying to run it.
("Debugging") lists three possibilities to consider if a function is not working.

Describe each possibility in your own words.

Define "precondition" and "post condition" as part of your description.

Create your own example of each possibility in Python code. List the code for each example, along with sample output from trying to run it.
Consider the following lines of Python code.

b = [23,44,87,100]
a = b[1:]
d = b[2:]
c = b
d[0] = 97
c[2] = 77
Which of the following holds at the end of this code?

a[1] == 77, b[2] == 77, c[2] == 77, d[0] == 97
a[1] == 87, b[2] == 87, c[2] == 77, d[0] == 97
a[1] == 87, b[2] == 77, c[2] == 77, d[0] == 97
a[1] == 97, b[2] == 77, c[2] == 77, d[0] == 97
One of the following 10 statements generates an error. Which one? (Your answer should be a number between 1 and 10.)

x = ["slithy",[7,10,12],2,"tove",1] # Statement 1
y = x[0:50] # Statement 2
z = y # Statement 3
w = x # Statement 4
x[0] = x[0][:5] + 'ery' # Statement 5
y[2] = 4 # Statement 6
z[4] = 42 # Statement 7
w[0][:3] = 'fea' # Statement 8
x[1][0] = 5555 # Statement 9
a = (x[4][1] == 1) # Statement 10


Consider the following lines of Python code.

b = [23,44,87,100]
a = b[1:]
d = b[2:]
c = b
d[0] = 97
c[2] = 77
How to write a program that accepts three decimals numbers as inputs and outputs their sum
Discuss the concept of parameters. What are parameters for? What is the difference between formal parameters and actual parameters? Give an example in Java code that illustrates formal parameters and actual parameters.
1. What is the value of endmsg after executing the following lines?

startmsg = "python"
endmsg = ""
for i in range(1,1+len(startmsg)):
endmsg = startmsg[-i] + endmsg

2.What is the value of mylist after the following lines are executed?

def mystery(l):
l = l[1:]
return()

mylist = [7,11,13]
mystery(mylist)

Write a program that accepts a whole number as input, multiplies that number by 12, and then outputs the product.


How would you write a regex that matches the full name of someone whose last name is Nakamoto? You can assume that the first name that comes before it will always be one word that begins with a capital letter.

The regex must match the following:

• 'Satoshi Nakamoto' • 'Alice Nakamoto' • 'RoboCop Nakamoto'

but not the following:

• 'satoshi Nakamoto' (where the first name is not capitalized) • 'Mr. Nakamoto' (where the preceding word has a nonletter character)
• 'Nakamoto' (which has no first name) • 'Satoshi nakamoto' (where Nakamoto is not capitalized)
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.
LATEST TUTORIALS
APPROVED BY CLIENTS