100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Questions on ENGR 102 Exam 2 QUESTIONS AND CORRECT DETAILED ANSWERS WITH RATIONALES 2025/2026 (VERIFIED ANSWERS) |ALREADY GRADED A+ $12.99
Add to cart

Exam (elaborations)

Questions on ENGR 102 Exam 2 QUESTIONS AND CORRECT DETAILED ANSWERS WITH RATIONALES 2025/2026 (VERIFIED ANSWERS) |ALREADY GRADED A+

 5 views  0 purchase
  • Course
  • ENGR 102
  • Institution
  • ENGR 102

Questions on ENGR 102 Exam 2 QUESTIONS AND CORRECT DETAILED ANSWERS WITH RATIONALES 2025/2026 (VERIFIED ANSWERS) |ALREADY GRADED A+

Preview 2 out of 6  pages

  • November 29, 2024
  • 6
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • engr 102
  • ENGR 102
  • ENGR 102
avatar-seller
Ashley96
Questions on ENGR 102 Exam 2

[:5]
is the five included? - ANS-NOPE
is going from 0-four
Can you multiple tuples? - ANS-nope
def add1(x):
if x + 1 < 10:
return x + 1
else:
return 'Too big!'
print(add1(1), add1(24)) - ANS-2 Too big!

Don't forget: the coma automatically creates a space
def Estellemail():
'''This funtion will explain how to write an email'''
print("Good Afternoon, nnPlease find attached...")
help(Estellemail)
Estellemail() - ANS-This funtion will explain how to write an email
Good Afternoon,
Please find attached...

First prints the help because we ask for it in the code
then prints the rest of the function bc we call it
def myfunction(a, b=2, c):
return a * b * c
print(myfunction(1, 2, 3)) - ANS-will print ERRRRROOOORR

to fix it:
def myfunction(a, b=2, c=2):
return a * b * c
print(myfunction(1, 2, 3))

#everything after the first thing you change has to change in the parameters
#maria's clear explanation: "a non default parameter can't follow a default parameter
#be better Estelle
def plus1_3(x):
return (x + 1, x + 3)
print(plus1_3(2)[0]) - ANS-3

Apparently tuples are kinda like list but you can't change them so they have indexes

, tuples = lame list
Errors:
syntax:

run-time: - ANS-using incorrect syntax --> syper will trap
code will no longer run at all maximum of the time

mistakes that manifest at the runtime
- user's fault
- infinite loop
- 0 division

common sense mistakes:
code will run but wrong output
regularly supply of trojan horse
import numpy as np
import matplotlib.Pyplot as plt
x = np.Linspace(-2, 2, 25)
y1 = x
y2 = x ** 2
plt.Plot(x, y1, 'g', linewidth = three)
plt.Plot(x, y2, 'k', marker = 'o', markerfacecolor = 'b')
plt.Axis([-2, 2, -2, 4])
plt.Xlabel('x')
plt.Ylabel('f(x)')
plt.Title('Plots for two polynomials')
plt.Legend(['straight', 'curved'], loc = 'higher middle')
plt.Display() - ANS-it is a completely high-quality graph, agree with me
<3
import numpy as np
mygrid = np.Arange(9).Reshape(3, 3)
print(mygrid)

print(mygrid[0])

print(mygrid[2][2])

myarray = np.Array([[0,1,2],[3,4,5],[6,7,8]])
print(myarray) - ANS-[[0 1 2]
[3 4 5]
[6 7 8]]

[0 1 2]

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller Ashley96. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $12.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

50064 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$12.99
  • (0)
Add to cart
Added