logo

Crowdly

Browser

Add to Chrome

Programming for Engineers || Spring25

Looking for Programming for Engineers || Spring25 test answers and solutions? Browse our comprehensive collection of verified answers for Programming for Engineers || Spring25 at elearn.squ.edu.om.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

View this question
What is printed by the following code snippet?
words = ["Today", "is", "Wednesday", "tomorrow", "is", "Thursday"]
i = 0
while i < (len(words)) :
   word = words[i]
   if len(word) < 8 :
      words.pop(i)
   else :
      i = i  + 1
print(words)    
View this question
To prevent aliasing, a new object can be created and the contents of the original can be copied to it.
100%
0%
View this question

Consider the following code segment:

 

  data = {"A": 65, "B": 66, "C": 67}

  print(data["Z"])

 

What will be displayed when this code segment executes?

View this question

Consider the following code segment:

def f1():

print("a", end="")

return "b"

def f2():

print("c", end="")

d = f1()

print(d, end="")

print("e", end="")

def f3():

print("f", end="")

f2()

print("g", end="")

f3()

  

What output is generated when it runs?

0%
0%
0%
0%
View this question

What is missing from this code snippet to find the longest

value in the list?

colors = ["red", "purple", "blue", "green", "yellow", "light green"]
longest = colors[0]
for i in range(1, len(colors)) :
   _____________________
      longest = colors[i]
0%
0%
0%
0%
View this question

Consider the following function:

def w(x, y) :
   z = x + y 
   return z

What is the function's name?

0%
0%
0%
0%
View this question
The index of the last item in a list is the length of the list.
50%
50%
View this question

The following code segment is supposed to display all of the elements in a list with dashes between them. For example, if values contains [1, 2, 3, 4, 5] then the program should display 1-2-3-4-5.

 

result = ""

for i in range(len(values)) :

   if i > 0 :

      _____________________

   result = result + str(values[i])

 

print(result)

What line of code should be placed in the blank to achieve this goal?

0%
0%
0%
0%
View this question

Consider the following function:

 

def mystery(a=3, b=2) :

   result = (a - b) * (a + b)

   return result

What is the result of calling mystery()?

View this question

Want instant access to all verified answers on elearn.squ.edu.om?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome