100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
ENGR 102 Exam 1 QUESTIONS AND WELL ELABORATED SOLUTIONS.ALREADY PASSED AND GRADED A $12.49   Add to cart

Exam (elaborations)

ENGR 102 Exam 1 QUESTIONS AND WELL ELABORATED SOLUTIONS.ALREADY PASSED AND GRADED A

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

ENGR 102 Exam 1 QUESTIONS AND WELL ELABORATED SOLUTIONS.ALREADY PASSED AND GRADED A Arrange the following mathematical operators in the correct order of operations according to Python. 1 is the first and 4 is the last. - ** // () - ANSWER () ** // - Booleans can onl...

[Show more]

Preview 2 out of 15  pages

  • September 1, 2024
  • 15
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • ENGR 102
  • ENGR 102
avatar-seller
TheExamMaestro
ENGR 102 Exam 1 QUESTIONS AND
WELL ELABORATED
SOLUTIONS.ALREADY PASSED AND
GRADED A
Arrange the following mathematical operators in the correct order of operations according to
Python. 1 is the first and 4 is the last.
-
**
//
() - ANSWER ()
**
//
-

Booleans can only have the values True or False - ANSWER True

In python, the data-type of a variable is implied based on how it was created or last assigned -
ANSWER True

Which of the following expressions produce a floating-point for variable x? Choose all that
apply.
x = str(2.7)
x = 0.5 * 10
x = 3.14
x = 1.0 + 2
x=7%3
x = - ANSWER x = 0.5 * 10
x = 3.14
x = 1.0 + 2
x = 5/5

Which of the following results in the Boolean value False?
bool('False')
bool('0')
int(False)
bool('') - ANSWER bool('')

Which of the following is a valid operation (will NOT result in an error)?
msg = "WHOOP!" - "!"
x = int('1.01')

, mystr = "ENGR" + str(102)
y = float('aggies') - ANSWER mystr = 'ENGR' + str(102)

mystr = "Diamond"
newstr = 'Reveille'
print(f'{15-10}-{mystr}:{newstr}') - ANSWER 5-Diamond:Reveille

Which of the following lines of code contain a function call? Choose all that apply
b = cos(pi / 4)
num = float(input("Enter a number: "))
z = bool(27)
print("Howdy, Ags!")
F = C * () + 32 - ANSWER ???

Which of the following examples use valid relational operators? Mark all that apply.
y=z+1
my_year == 2023
my_classes >= 3
my_dog != 'Reveille - ANSWER my_year == 2023
my_classes >= 3
my_dog != 'Reveille

What is the output of the following code?
a=5
b=3
c = 10
d = ((a < b) and (b < c)) or (not(c == 20) and (a != 10))
print(d)
Maybe
True
False
The code produces an error - ANSWER True

Prompt the user to input a number
If the user inputs a negative number, print an error message and do no calculations
Otherwise, calculate and print the square root of the number
Include text to the user when asking for a number and describing the answer
Include (helpful) comments in your code so we can follow your thought process
You are not required to do any special string formatting of the output
Example output (using input 2):
Enter a number: 2
The square root of 2.0 is 1.4142135623730951 - ANSWER from math import *
num = float(input('Please enter a number: '))
if num < 0:
print('Error')
elif num >= 0:

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 TheExamMaestro. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

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

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

81989 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.49
  • (0)
  Add to cart