Question

List some differences between a script and a function.

Solution

Verified
Answered 1 year ago
Answered 1 year ago
  • A function is called whereas a script is executed.
    • A function typically has end at the end of the file.
    • A function has a header whereas a script does not.
    • Arguments are passed to functions but not to scripts.
    • Functions can return arguments whereas scripts cannot.
    • The block comment is typically in the beginning of a script but under the function header.
    • The scope of variables is different: scripts use the base workspace, whereas functions have their own workspaces.

Create an account to view solutions

By signing up, you accept Quizlet's Terms of Service and Privacy Policy
Continue with GoogleContinue with Facebook

Create an account to view solutions

By signing up, you accept Quizlet's Terms of Service and Privacy Policy
Continue with GoogleContinue with Facebook

Recommended textbook solutions

Computer Organization and Design MIPS Edition: The Hardware/Software Interface 5th Edition by David A. Patterson, John L. Hennessy

Computer Organization and Design MIPS Edition: The Hardware/Software Interface

5th EditionISBN: 9780124077263 (5 more)David A. Patterson, John L. Hennessy
220 solutions
MATLAB: A Practical Introduction to Programming and Problem Solving 4th Edition by Stormy Attaway

MATLAB: A Practical Introduction to Programming and Problem Solving

4th EditionISBN: 9780128045251 (1 more)Stormy Attaway
461 solutions
Fundamentals of Database Systems 7th Edition by Ramez Elmasri, Shamkant B. Navathe

Fundamentals of Database Systems

7th EditionISBN: 9780133970777 (1 more)Ramez Elmasri, Shamkant B. Navathe
687 solutions
Introduction to Algorithms 3rd Edition by Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen

Introduction to Algorithms

3rd EditionISBN: 9780262033848 (2 more)Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen
726 solutions