Question
List some differences between a script and a function.
Solution
VerifiedAnswered 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
Create an account to view solutions
By signing up, you accept Quizlet's Terms of Service and Privacy Policy
Recommended textbook solutions

Computer Organization and Design MIPS Edition: The Hardware/Software Interface
5th Edition•ISBN: 9780124077263 (5 more)David A. Patterson, John L. Hennessy220 solutions

MATLAB: A Practical Introduction to Programming and Problem Solving
4th Edition•ISBN: 9780128045251 (1 more)Stormy Attaway461 solutions

Fundamentals of Database Systems
7th Edition•ISBN: 9780133970777 (1 more)Ramez Elmasri, Shamkant B. Navathe687 solutions

Introduction to Algorithms
3rd Edition•ISBN: 9780262033848 (2 more)Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen726 solutions