logo

Crowdly

Browser

Add to Chrome

Programming for Engineers -Summer25

Looking for Programming for Engineers -Summer25 test answers and solutions? Browse our comprehensive collection of verified answers for Programming for Engineers -Summer25 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!

Consider the following list:

values = [12, 4, 8, 16, 24]

Which statement displays the last element in the list?

0%
0%
0%
0%
View this question

A teacher stores students' grades in a dictionary:

grades = {"Alice": 85, "Bob": 92, "Charlie": 78}

grades["Diana"] = 88

print(len(grades))

What is the output when this code is executed?

View this question
A program stores the number of books each student has read in a dictionary:

books_read = {"Ali": 3, "Sara": 5, "Omar": 2}

books_read["Omar"] += 1

print(books_read["Omar"])

What is the output when the code is executed?

View this question

What code completes this code snippet to swap the first and

last element in the list?

states = ["Alaska", "Hawaii", "Florida", "Maine"]
i = 0
________________________
temp = states[j]
states[j] = states[0]
states[i] = temp
0%
0%
0%
0%
View this question
A dictionary is used to store the color of fruits:

fruit_colors = {"Apple": "Green", "Banana": "Yellow"}

fruit_colors["Apple"] = "Red"

What is the value of fruit_colors after this code is executed?

0%
0%
0%
0%
View this question

Given the following code:

inventory = {"pen": 10, "notebook": 5, "eraser": 7}

inventory.clear()

print(inventory)

Which dictionary operation is used, and what is the output?

View this question

Consider the following code segment:

scores = [5, 3, 7, 9, 1]

top_two = scores[:2]

print(top_two)

what is displayed when it executes?
View this question
A student keeps track of homework submissions using a list:

homework = ["math", "science", "english"]

homework.append("history")

print(homework[-1])

What is the output when this code is executed?

View this question
A program calculates the total score from a list of quiz results:

scores = [10, 8, 7]

total = 0

for s in scores:

    total += s

print(total)

What is the output when this code is executed?

0%
0%
0%
0%
View this question

Write a Python program  that reads a file containing numbers (possibly across multiple lines). The program should:

  1. Convert the values to floats.

  2. Store them in a list.

  3. Compute and print the average (mean) of all numbers in the file.

A sample text is given by:

10 20 30

25 35

15 5 10

A sample code execution is:

Enter the filename: text3.txt

The average is 18.75

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