Video 2.3 Introduction to Python Functions.docx - Video...

This preview shows page 1 - 2 out of 5 pages.

The preview shows page 1 - 2 out of 5 pages.
Video 2-2: Basic Python Data Structures:Lesson 2-2 Video: Python FunctionsHello, in this lesson we will be introducing the concept of a function, and howit’s used in a Python program or script.Much like the equivalent in mathematics, a function takes input, andgenerates output.Now, the reason we like to use functions in programming, is that byencapsulating details of an algorithm, you can promote code reuse,increase efficiency by leveraging previous work, and reduce thelikelihood for errors to occur.Basically, if you write a function and it does a certain thing, and it doesit correctly, you can then reuse that code.oIt makes it easier for you to write new code that leverages thatexisting code.oAnd once that code has been debugged, and you know it worksright, you don’[t have to worry about whether that particular partof your data analytic script is working correctly.So, functions are very good, they’re very important, and we’re going towant to use them a lot.Now in this lesson, you’re going to learn how to create a function, andthis function can take arguments or input, sometimes they don’t takeinput.oThey’ll also learn how to process that input inside a function andto do things.oAnd then we’ll also see, how do you return data from a function?Now, one other thing that we’re going to explore is something calledunnamed functions.

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 5 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
N/A
Tags
Object Oriented Programming, Subroutine, Analytic function

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture