Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Pyhton Define three variables var 1 , var 2 and var 3 . Calculate the average of these variables and assign it to average. Print

Pyhton
Define three variables var1, var2 and var3. Calculate the average of these variables and assign it to average. Print the average. Add at least one comment.
Examples:
% python3 prog06.py
enter var1: 1
enter var2: 2
enter var3: 3
the average is: 2.0
% python3 prog06.py
enter var1: 3
enter var2: 5
enter var3: 7
the average is: 5.0
% python3 prog06.py
enter var1: 2
enter var2: 5
enter var3: 7
the average is: 4.666666666666667
%
put the code in a file called prog06.py
use the following code as a starter.
var1= int(input("enter var1: "))
var2= int(input("enter var2: "))
var3= int(input("enter var3: "))
#your code starts here:
#your code ends here

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

OpenStack Trove

Authors: Amrith Kumar, Douglas Shelley

1st Edition

1484212215, 9781484212219

More Books

Students also viewed these Databases questions