1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
liq [111]
3 years ago
11

Create your own Python code examples that demonstrate each of the following. Do not copy examples from the book or any other sou

rce. Try to be creative with your examples to demonstrate that you invented them yourself.
Example 1: Define a function that takes an argument. Call the function. Identify what code is the argument and what code is the parameter.

Example 2: Call your function from Example 1 three times with different kinds of arguments: a value, a variable, and an expression. Identify which kind of argument is which.

Example 3: Create a function with a local variable. Show what happens when you try to use that variable outside the function. Explain the results.

Example 4: Create 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.

Example 5: Show what happens when a variable defined 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.
Computers and Technology
1 answer:
natulia [17]3 years ago
6 0
Ssfhooiyfbjkoyfvhkodd
You might be interested in
Rectangular box formed when each column meet​
Over [174]

Answer:

If this is a true or false I guess my answer is true?

Explanation:

3 0
3 years ago
Which one of the following oscilloscope controls is used to move the trace up and down the screen vertically? A. Focus B. Sweep
Andre45 [30]
<span>the trace position is surprise surprise controlled by the position knob!</span>
4 0
3 years ago
How to write a C++ program that allows a user to enter their rating of the three movies in the Dark Knight Trilogy and then disp
8_murik_8 [283]

The program is an illustration of arrays.

Arrays are used to hold multiple values in one variable.

The program in C++ where comments are used to explain each line is as follows:

#include <iostream>

using namespace std;

int main(){

   //This declares an array of three elements for the three ratings

   int ratings[3];

   //This initializes the sum of the ratings to 0

   int total = 0;

   //The following iteration gets input for the three ratings

   for(int i = 0; i<3;i++){

       cin>>ratings[i];

       //This calculates the sum of all inputs

       total+=ratings[i];

   }

   //This declares and initializes the lowest and the highest ratings

   int lowest = ratings[0], highest = ratings[0];

   //This iterates through the array

   for(int i = 1; i<3;i++){

       //The following if condition determines the lowest rating

       if (lowest > ratings[i]){    lowest = ratings[i];        }

       //The following if condition determines the highest rating

       if (highest < ratings[i]){            highest = ratings[i];        }

   }

   //This prints the output header

   cout<<"The ratings are: ";

   //The following iteration prints the three ratings

   for(int i = 0; i<3;i++){

       cout<<ratings[i]<<" ";   }

   //The prints the highest ratings

cout<<endl<<"Highest: "<<highest<<endl;

   //The prints the lowest rating

   cout<<"Lowest: "<<lowest<<endl;

   //The prints the average rating

cout<<"Average: "<<total/3<<endl;

   return 0;

}

At the end of the program, the ratings entered, the highest rating, the lowest rating, and the average of the ratings are printed.

See attachment for sample run

Read more about similar programs at:

brainly.com/question/13261254

8 0
2 years ago
When is an original work considered public domain?
Blababa [14]

The correct answer isn’t really a choice shown. I would choose D because if a work doesn’t have a copyright symbol that doesn’t mean it’s in the public domain. In a real life situation it would be best to ask the creator before you use their work. If they say it’s in the public domain then you’re fine, but even if they say you can use it that doesn’t mean it’s in the public domain, it just means that you have permission to use it.

7 0
3 years ago
How does design influence the product's function?
r-ruslan [8.4K]
I think the answer is
8 0
3 years ago
Other questions:
  • In a case where electrical current leakage from the circuit occurs,
    7·2 answers
  • Before responding to an e-mail from another student in an online course, a student should
    13·2 answers
  • You just received a message from the internet which was encrypted with asymmetric encryption. what do you need to do to read the
    12·1 answer
  • (BRAINLIEST QUESTION) What are some challenges that will need to be overcome in order for the Internet of Vehicles to become a r
    13·1 answer
  • A network administrator recently implemented two caching proxy servers on the network. how can the administrator best aggregate
    5·1 answer
  • Write a function called simulate_several_key_strikes. It should take one argument: an integer specifying the number of key strik
    7·1 answer
  • Why laptop computer is called micro computer?​
    8·1 answer
  • Select the two statements below that are true. Press on the info button for
    13·1 answer
  • What is a function of Agile software development?<br>​
    7·1 answer
  • Cómo se llaman los robots que se utilizan para la exploración espacial, en medicina, en la industria, en la agricultura, los que
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!