CS 1101 Learning Guide Unit 2 Discussion Assignment Home
CS 1101 Learning Guide Unit 2 Discussion Assignment Home
id=412647&chapterid=497868
Write your own Python code examples that demonstrate each of the following. Do not copy examples from the book or any other source. Try
to be creative with your examples to demonstrate that you invented them yourself.
: De�ne a function that takes an argument. Call the function. Identify what code is the argument and what code is the parameter.
: Call your function from Example 1 three times with di�erent kinds of arguments: a value, a variable, and an expression. Identify
which kind of argument is which.
: Construct a function with a local variable. Show what happens when you try to use that variable outside the function. Explain the
results.
: Construct a function that takes an argument. Give the function parameter a unique name. Show what happens when you try to
use that parameter name outside the function. Explain the results.
: Show what happens when a variable de�ned outside a function has the same name as a local variable inside a function. Explain
what happens to the value of each variable as the program runs.
The code and its output must be explained technically whenever asked. The explanation can be provided before or after the code, or in the
form of code comments within the code. For any descriptive type question, Your answer must be at least 150 words.
End your discussion post with one question related to programming fundamentals learned in this unit from which your colleagues can
formulate a response or generate further discussion. Remember to post your initial response as early as possible, preferably by Sunday
evening, to allow time for you and your classmates to have a discussion.
1 of 2 4/18/2024, 9:02 PM
Learning Guide Unit 2: Discussion Assignment | Home https://my.uopeople.edu/mod/book/view.php?id=412647&chapterid=497868
2 of 2 4/18/2024, 9:02 PM