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!

Write a Python program that:

  1. Prompts the user to enter 5 integer numbers.

  2. Checks if each number is even.

  3. If the number is even, writes it to a file named even_numbers.txt, each on a new line.

  4. After all inputs, reads the file and:

    • Prints all even numbers

    • Prints their total sum

Hint: Don't use list in this question

Expected Output Example:

Enter number 1: 4

Enter number 2: 7

Enter number 3: 2

Enter number 4: 9

Enter number 5: 6

Even numbers in the file: 4 2 6

Total of even numbers: 12

View this question

How to extract a substring from 'Hello World' to get 'World'?

0%
0%
0%
0%
View this question

What is the result of '5' * 3?

View this question

What will this code output?

for i in range(1, 4):

if i == 2:

break

print(i)

View this question

Write a Python program that:

  1. Asks the user to enter their name and age.

  2. Calculates the user's age in 10 years.

  3. Displays a message using %s, %d, %f:

Expected Output Format:

Enter your name: Alice

Enter your age: 25

Hello Alice, you are 25 years old. In 10 years, you will be 35.0.

View this question

What is the output of:

x = 5

if x > 3:

print('Yes')

else:

print('No')

0%
0%
0%
0%
View this question

How do you write multiple lines of comments?

View this question
View this question

Which of these opens a file for both reading and writing?

View this question

What is the correct way to create a variable in Python?

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