[Tutor] how do I set variables in Python 3.4
Danielle Salaz
danieshari at gmail.com
Tue Jul 15 07:51:13 CEST 2014
This is the assignment:
Write a Python script as follows:
Use 3 variables named:
operand1
operand2
result
Set operand1 = 2 and operand2 = 7.
Evaluate the following expressions and produce the output as shown:
result = operand1 + operand2
result = operand2 – operand1
result = operand2 * operand1
result = operand2 / operand1
result = operand2 % operand1
Your output should look like:
operand1 = 2
operand2 = 7
2 + 7 = 9
7 – 2 = 5
7 * 2 = 14
etc.
I am using Python 3.4 and my OS is Windows 7 Ultimate.
Thank you everyone for all of your help
On Sun, Jul 13, 2014 at 10:41 AM, Danny Yoo <dyoo at hashcollision.org> wrote:
> On Sun, Jul 13, 2014 at 12:25 AM, Danielle Salaz <danieshari at gmail.com>
> wrote:
> > This is what I've been doing, also I'm using version 3.4
> >
> > set "(operand1 = 2 and operand2 = 7)
> > print (operand1 = 2)
> > print (operand2 = 7)
> > print (result=operand1 + operand2)
> > print (result=operand2 - operand1)
> > print (result=operand2 * operand1)
> > print (result=operand2 / operand1)
> > print (result=operand2 % operand1)
>
>
> Beyond what Alan has said, also please also also say what you expected
> to happen if the program were to run without error.
>
> I mentioned this earlier in a prior reply in this thread, and I still
> stick by the recommendation. We want to help troubleshoot any
> misconceptions as early as possible, and knowing intent is helpful.
>
> Since you are a beginner, try to explain each line and the overall
> program goal if possible. It will help us understand what programming
> model you've got in your head. For example, can you explain what the
> first three lines of your program are intended to do?
>
--
Thank you,
Danielle Salaz
Signature Financial Services, Inc.
21 W. Laurel Dr. #47, Salinas, Ca. 93906
(831) 754-0600
Your perception has everything to do with your progression!!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20140714/459d3aa7/attachment.html>
More information about the Tutor
mailing list