100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Engr 102 exam 2 (lectures 7-13) Questions and Answers with Complete Solutions |100% Pass $13.24   Add to cart

Exam (elaborations)

Engr 102 exam 2 (lectures 7-13) Questions and Answers with Complete Solutions |100% Pass

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

Engr 102 exam 2 (lectures 7-13) Questions and Answers with Complete Solutions |100% Pass

Preview 3 out of 17  pages

  • October 24, 2024
  • 17
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • ENGR 102
  • ENGR 102
avatar-seller
Examsplug
Engr 102 exam 2 (lectures 7-13) Questions and
Answers with Complete Solutions |100% Pass




why we pass data to/from functions - ✔✔functions are separate parts of the code and
may have different access to data in the main code




how we pass data to /from functions - ✔✔through parameters/arguments




how is data returned from a function - ✔✔return values




tuples - ✔✔like a list, immutable, can still use computations




format of types - ✔✔commas -- tuple1 = 1, 2, 3

parenthesis -- tuple2 = (1, 2, 3)




returning tuples - ✔✔a function can only return 1 value, but that value can be a tuple




where do we get functions? - ✔✔built in functions, user written functions, import
from modules

,modules - ✔✔single file with code that someone else wrote




multiple modules - ✔✔package




type of organization in modules - ✔✔library




importing modules - ✔✔modules define functions




importing a whole modules - ✔✔import <whole name>




to use imported modules - ✔✔<module name>.<function name>(argument)




importing an individual module - ✔✔from <module name> import <function name>




to use individual modules - ✔✔dont need to call them first




packages - ✔✔collection of related modules




how to use packages - ✔✔<package>.<module name> (submodule)

, function definition - ✔✔def <function> (parameters) : -- "header"

do something




common practice when defining functions - ✔✔define all functions above main body of code




common structure of overall program - ✔✔1- import statements

2- define functions

3- main code




function body = - ✔✔own "separate" program




variables in functions - ✔✔you can create variables in function body and they'll live other
area, since they live somewhere else... you can reuse variable names




scopes - ✔✔a scope of a variable refers to the regions of the program that the variable is
valid and can be accessed.




2 types of scopes - ✔✔global or local




global scopes - ✔✔a variable defined throughout the program, can be used anywhere
in program

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

Will I be stuck with a subscription?

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

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

75759 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
$13.24
  • (0)
  Add to cart