[Tutor] Tutor Digest, Vol 161, Issue 42

Borisco Bizaro boriscobizaro8 at gmail.com
Wed Aug 2 15:53:05 EDT 2017


I try this using loop but could not stop by pressing a key and could not
give total price please help me
On Jul 31, 2017 13:07, boriscobizaro8 at gmail.com wrote:

print"\n welcome to progrom that print total price\n"
a=int(input("enter the first price: "))
b=int(input ("enter another price: "))
c=int(input ("enter another price: "))
d=int(input ("enter another price: "))
f=int(input ("enter another price: "))
g=int(input ("enter another price: "))
h=int(input ("enter another price: "))
total=a+b+c+d+f+g+h
print"\n totol",a+b+c+d+f+g+h
print("\n\n press the o key to exit ")
This is what I did but could not be able to used while loop
On Jul 30, 2017 23:44, <tutor-request at python.org> wrote:

Send Tutor mailing list submissions to
        tutor at python.org

To subscribe or unsubscribe via the World Wide Web, visit
        https://mail.python.org/mailman/listinfo/tutor
or, via email, send a message with subject or body 'help' to
        tutor-request at python.org

You can reach the person managing the list at
        tutor-owner at python.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Tutor digest..."

Today's Topics:

   1. Re: Tutor Digest, Vol 161, Issue 41 (Borisco Bizaro)
   2. Re: Tutor Digest, Vol 161, Issue 41 (Alan Gauld)
   3. Re: Tutor Digest, Vol 161, Issue 33 (Borisco Bizaro)


---------- Forwarded message ----------
From: Borisco Bizaro <boriscobizaro8 at gmail.com>
To: tutor at python.org
Cc:
Bcc:
Date: Sun, 30 Jul 2017 11:50:22 -0700
Subject: Re: [Tutor] Tutor Digest, Vol 161, Issue 41
Please I have been ask to write python code that ask user to enter a price
continuetly until key press to and give the total amount of price I have
enter using while loop I don't know how to go about it,please help me
On Jul 29, 2017 17:00, <tutor-request at python.org> wrote:

> Send Tutor mailing list submissions to
>         tutor at python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://mail.python.org/mailman/listinfo/tutor
> or, via email, send a message with subject or body 'help' to
>         tutor-request at python.org
>
> You can reach the person managing the list at
>         tutor-owner at python.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Tutor digest..."
>
> Today's Topics:
>
>    1. Installing NUMPY (David Torres)
>
>
> ---------- Forwarded message ----------
> From: David Torres <davidtorres7888 at gmail.com>
> To: tutor at python.org
> Cc:
> Bcc:
> Date: Fri, 28 Jul 2017 15:10:53 -0500
> Subject: [Tutor] Installing NUMPY
> Hello,
> I am having trouble executing a scripty that imports numpy. I have a
> feeling its because I had an old version of Numpy when I was using python
> 2.7. I am now using Pyhton 3X and I am getting the following error when I
> execute the program:::
>
>
> ImportError:
> Importing the multiarray numpy extension module failed.  Most
> likely you are trying to import a failed build of numpy.
> If you're working with a numpy git repo, try `git clean -xdf` (removes all
> files not under version control).  Otherwise reinstall numpy.
>
> Original error was: DLL load failed: The specified procedure could not be
> found.
>
>
>
> Please let me know if we can email each other or call. I would appreciate
> your help, I am very desperate! Thanks
> David A. Torres
> GitHub : https://github.com/dav1dt0rres
> -Man lives like a robot: mechanically efficient, but with no awareness.
> Department of Computer Science
>
>
>
> Department of Mathematics
> Department of Economics
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> https://mail.python.org/mailman/listinfo/tutor
>
>



---------- Forwarded message ----------
From: Alan Gauld <alan.gauld at yahoo.co.uk>
To: tutor at python.org
Cc:
Bcc:
Date: Sun, 30 Jul 2017 23:40:57 +0100
Subject: Re: [Tutor] Tutor Digest, Vol 161, Issue 41
On 30/07/17 19:50, Borisco Bizaro wrote:
> Please I have been ask to write python code that ask user to enter a price
> continuetly until key press to and give the total amount of price I have
> enter using while loop I don't know how to go about it

First of all, please do not send the whole digest to the list
 - some people pay by the byte and we've all seen it already.

Second, we solve programming challenges by breaking them down
into small parts and solving each part.

Third we don't do homework for you, but we can point you
in the right direction.

So, looking at your problem...

> ...write python code that ask user to enter a price

Do you know how to do that bit? get the usr to enter
a price and store (or print) the value?

> continuetly until key press

We'll come back to this.

> to and give the total amount of price

Do you know how to get the total of a list of prices?
For exanmple if I say

prices = [12, 13.00, 24.50. 17. 5.30]

Can you print the total of prices?

> enter using while loop

This ties in with the earlier requirement:

> enter using while loop
> continuously until key press

Lets assume the "keypress" is 0.
Do you know how to write a while loop that terminates
when an input value is 0?

Let us know the answers and we can point you
a little further towards solving the problem.

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos





---------- Forwarded message ----------
From: Borisco Bizaro <boriscobizaro8 at gmail.com>
To: tutor at python.org
Cc:
Bcc:
Date: Sun, 30 Jul 2017 15:36:07 -0700
Subject: Re: [Tutor] Tutor Digest, Vol 161, Issue 33
Please I have been ask to write python code that ask user to enter a price
continuetly until key press to and give the total amount of price I have
enter using while loop I don't know how to go about it,please help me
This is what I have done,
untitled
a=1
b=2
while a<b:
  input ("enter another price :")
print"\n\n press 0 key to stop"
On Jul 24, 2017 01:06, <tutor-request at python.org> wrote:

> Send Tutor mailing list submissions to
>         tutor at python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://mail.python.org/mailman/listinfo/tutor
> or, via email, send a message with subject or body 'help' to
>         tutor-request at python.org
>
> You can reach the person managing the list at
>         tutor-owner at python.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Tutor digest..."
>
> Today's Topics:
>
>    1. Fwd: Re:  Python Help (Alan Gauld)
>    2. Fwd: Re:  Python Help (Alan Gauld)
>    3. Python3 Help (Brandon Anderson)
>    4. class newbie (Michael C)
>
>
> ---------- Forwarded message ----------
> From: Alan Gauld <alan.gauld at yahoo.co.uk>
> To: tutor <tutor at python.org>
> Cc:
> Bcc:
> Date: Sun, 23 Jul 2017 21:45:45 +0100
> Subject: [Tutor] Fwd: Re: Python Help
>
> Forwarding to list,
> please use ReplyAll or ReplyList when responding to the list.
>
>
> -------- Forwarded Message --------
>
> I also tried the correct command for the mac ox s in terminal shell,
> running:
>
> Jims-MacBook-Pro-2:~ Jim$
> PYTHONPATH="/Users/Jim/Documents/illustris_python:$PYTHONPATH
>
> > export PYTHONPATH
>
>
> no error messages there but it is still not finding the module through
> python.
>
> Winonah
>
>
> On Sun, Jul 23, 2017 at 1:34 PM, Winonah Ojanen <winonah1992 at gmail.com
> <mailto:winonah1992 at gmail.com>> wrote:
>
>     I did use the pip command and am attempting to add the files to my
>     python path. I used
>      import sys
>     sys.path.append("/Users/Jim/Documents/illustris_python")
>
>     and that worked. I even checked to make sure the files were there
>
>
>     import sys
>     print (sys.path)
>
>     ['', '/Users/Jim/anaconda/lib/python36.zip',
>     '/Users/Jim/anaconda/lib/python3.6',
>     '/Users/Jim/anaconda/lib/python3.6/lib-dynload',
>     '/Users/Jim/anaconda/lib/python3.6/site-packages',
>     '/Users/Jim/anaconda/lib/python3.6/site-packages/
> Sphinx-1.5.6-py3.6.egg',
>     '/Users/Jim/anaconda/lib/python3.6/site-packages/aeosa',
>     '/Users/Jim/anaconda/lib/python3.6/site-packages/
> setuptools-27.2.0-py3.6.egg',
>     '/Users/Jim/anaconda/lib/python3.6/site-packages/IPython/extensions',
>     '/Users/Jim/.ipython', 'Users/Jim/Documents/illustris_python']
>
>     the file is clearly there but when i try to do import
>     illustris_python as il it still can't find the module.
>
>
> Note that only shows the folder is in the path.
>
> What does an 'ls' listing reveal as to the contents of the folder?
> Is there a file called illustris_python.py? or maybe illustris_python.pyc?
>
>
>
>     I also figured that I need to manually export to python path so i
> tried:
>     export PYTHONPATH=$PYTHONPATH:/Users/Jim/Documents/illustris_python/
>       File "<ipython-input-14-30d153a77da5>", line 1
>         export PYTHONPATH=$PYTHONPATH:/Users/Jim/Documents/illustris_
> python/
>                         ^
>     SyntaxError: invalid syntax
>
>     I got invalid syntax... using a mac os x
>
>     I tried typing in terminal open .bash_profile and telling it to
>     export the python path in there like some others recommended but in
>     terminal it is giving me an error message for that... it must not be
>     the right command for the shell.
>
>     Winonah
>
>     On Sat, Jul 22, 2017 at 9:34 PM, Cameron Simpson <cs at zip.com.au
>     <mailto:cs at zip.com.au>> wrote:
>
>         On 23Jul2017 00:20, Alan Gauld <alan.gauld at yahoo.co.uk
>         <mailto:alan.gauld at yahoo.co.uk>> wrote:
>
>             On 22/07/17 19:14, Winonah Ojanen wrote:
>
>                 using python with anaconda in jupiter notebook. However,
>                 I am having
>
>
>             Usual caveat: The tutor list is targeted at the standard
> library
>             so any help for non standard library modules is best sought
> from
>             the library support fora. In this case that includes the
>             SciPy forum
>             and any illustris one.
>
>
>         Though arguably the OP's problem is an import issue, not really
>         module specific.
>
>             That having been said, I'll take a guess...
>
>                 $ mkdir Illustris-3
>                 $ mkdir Illustris-3/groups_135
>
>             Are these folders in your PYTHONPATH? If not Python will not
>             find them.
>
>                 import illustris_python as il
>                 ------------------------------
> ---------------------------------------------
>                 ModuleNotFoundError                       Traceback
>                 (most recent call last)
>
>
>         The OP cded into the new dir; I'd normally expect things to be
>         found if the module was a local file/dir. However...
>
>                 For some reason the computer is not recognizing this as
>                 a file on my
>                 computer. The CCA folks says this is a coding problem
>                 and not an illustris
>                 problem. any ideas to get me past this? I may also need
>                 help getting
>                 farther into the download process.
>
>
>         I just ran the OP's download command:
>
>          wget -nd -nc -nv -e robots=off -l 1 -r -A hdf5
>         --content-disposition --header="API-Key:
>         d522db2e1b33e36d3b365cc9ac1c2c5d"
>         "http://www.illustris-project.org/api/Illustris-3/files/
> groupcat-135/?format=api
>         <http://www.illustris-project.org/api/Illustris-3/files/
> groupcat-135/?format=api>"
>
>         This doesn't seem to download any Python code at all. It does
>         get a couple of HDF files, presumably with data to work with.
>
>         So the issue is initially that the module isn't present
>         anywhere. Looking at the instructions cited
>         <http://www.illustris-project.org/data/docs/scripts/
>         <http://www.illustris-project.org/data/docs/scripts/>>, they
>         only cover fetching som data and working; they presume the
>         software is already present. I don't immediately see actual
>         software installation instructions, and it is not presented in
> PyPI.
>
>         Most like the OP will have to install the software directly from:
>
>          https://bitbucket.org/illustris/illustris_python
>         <https://bitbucket.org/illustris/illustris_python>
>
>         This command:
>
>          hg clone
>         https://bitbucket.org/illustris/stris_pythonillustris_python
>         <https://bitbucket.org/illustris/stris_pythonillustris_python>
>
>         should produce an "illustris_python" in the current directory,
>         and then her import command will find it.
>
>         However, there are other prerequisites. This pip command:
>
>          pip install h5py numpy
>
>         seems to resolve them. The OP will need to use Python 2 because
>         the module seems to rely on a relative import (for its "util.py"
>         file).
>
>         Cheers,
>         Cameron Simpson <cs at zip.com.au <mailto:cs at zip.com.au>>
>
>         _______________________________________________
>         Tutor maillist  -  Tutor at python.org <mailto:Tutor at python.org>
>         To unsubscribe or change subscription options:
>         https://mail.python.org/mailman/listinfo/tutor
>         <https://mail.python.org/mailman/listinfo/tutor>
>
>
>
>
>
>
> ---------- Forwarded message ----------
> From: Alan Gauld <alan.gauld at yahoo.co.uk>
> To: tutor <tutor at python.org>
> Cc:
> Bcc:
> Date: Sun, 23 Jul 2017 21:42:26 +0100
> Subject: [Tutor] Fwd: Re: Python Help
> Forwarding to list
>
>
>
> -------- Forwarded Message --------
>
> I did use the pip command and am attempting to add the files to my
> python path. I used
>  import sys
> sys.path.append("/Users/Jim/Documents/illustris_python")
>
> and that worked. I even checked to make sure the files were there
>
>
> import sys
> print (sys.path)
>
> ['', '/Users/Jim/anaconda/lib/python36.zip',
> '/Users/Jim/anaconda/lib/python3.6',
> '/Users/Jim/anaconda/lib/python3.6/lib-dynload',
> '/Users/Jim/anaconda/lib/python3.6/site-packages',
> '/Users/Jim/anaconda/lib/python3.6/site-packages/Sphinx-1.5.6-py3.6.egg',
> '/Users/Jim/anaconda/lib/python3.6/site-packages/aeosa',
> '/Users/Jim/anaconda/lib/python3.6/site-packages/
> setuptools-27.2.0-py3.6.egg',
> '/Users/Jim/anaconda/lib/python3.6/site-packages/IPython/extensions',
> '/Users/Jim/.ipython', 'Users/Jim/Documents/illustris_python']
>
> the file is clearly there but when i try to do import illustris_python
> as il it still can't find the module.
>
> I also figured that I need to manually export to python path so i tried:
> export PYTHONPATH=$PYTHONPATH:/Users/Jim/Documents/illustris_python/
>   File "<ipython-input-14-30d153a77da5>", line 1
>     export PYTHONPATH=$PYTHONPATH:/Users/Jim/Documents/illustris_python/
>                     ^
> SyntaxError: invalid syntax
>
> I got invalid syntax... using a mac os x
>
> I tried typing in terminal open .bash_profile and telling it to export
> the python path in there like some others recommended but in terminal it
> is giving me an error message for that... it must not be the right
> command for the shell.
>
> Winonah
>
> On Sat, Jul 22, 2017 at 9:34 PM, Cameron Simpson <cs at zip.com.au
> <mailto:cs at zip.com.au>> wrote:
>
>     On 23Jul2017 00:20, Alan Gauld <alan.gauld at yahoo.co.uk
>     <mailto:alan.gauld at yahoo.co.uk>> wrote:
>
>         On 22/07/17 19:14, Winonah Ojanen wrote:
>
>             using python with anaconda in jupiter notebook. However, I
>             am having
>
>
>         Usual caveat: The tutor list is targeted at the standard library
>         so any help for non standard library modules is best sought from
>         the library support fora. In this case that includes the SciPy
> forum
>         and any illustris one.
>
>
>     Though arguably the OP's problem is an import issue, not really
>     module specific.
>
>         That having been said, I'll take a guess...
>
>             $ mkdir Illustris-3
>             $ mkdir Illustris-3/groups_135
>
>         Are these folders in your PYTHONPATH? If not Python will not
>         find them.
>
>             import illustris_python as il
>             ------------------------------------------------------------
> ---------------
>             ModuleNotFoundError                       Traceback (most
>             recent call last)
>
>
>     The OP cded into the new dir; I'd normally expect things to be found
>     if the module was a local file/dir. However...
>
>             For some reason the computer is not recognizing this as a
>             file on my
>             computer. The CCA folks says this is a coding problem and
>             not an illustris
>             problem. any ideas to get me past this? I may also need help
>             getting
>             farther into the download process.
>
>
>     I just ran the OP's download command:
>
>      wget -nd -nc -nv -e robots=off -l 1 -r -A hdf5
>     --content-disposition --header="API-Key:
>     d522db2e1b33e36d3b365cc9ac1c2c5d"
>     "http://www.illustris-project.org/api/Illustris-3/files/
> groupcat-135/?format=api
>     <http://www.illustris-project.org/api/Illustris-3/files/
> groupcat-135/?format=api>"
>
>     This doesn't seem to download any Python code at all. It does get a
>     couple of HDF files, presumably with data to work with.
>
>     So the issue is initially that the module isn't present anywhere.
>     Looking at the instructions cited
>     <http://www.illustris-project.org/data/docs/scripts/
>     <http://www.illustris-project.org/data/docs/scripts/>>, they only
>     cover fetching som data and working; they presume the software is
>     already present. I don't immediately see actual software
>     installation instructions, and it is not presented in PyPI.
>
>     Most like the OP will have to install the software directly from:
>
>      https://bitbucket.org/illustris/illustris_python
>     <https://bitbucket.org/illustris/illustris_python>
>
>     This command:
>
>      hg clone
>     https://bitbucket.org/illustris/stris_pythonillustris_python
>     <https://bitbucket.org/illustris/stris_pythonillustris_python>
>
>     should produce an "illustris_python" in the current directory, and
>     then her import command will find it.
>
>     However, there are other prerequisites. This pip command:
>
>      pip install h5py numpy
>
>     seems to resolve them. The OP will need to use Python 2 because the
>     module seems to rely on a relative import (for its "util.py" file).
>
>     Cheers,
>     Cameron Simpson <cs at zip.com.au <mailto:cs at zip.com.au>>
>
>     _______________________________________________
>     Tutor maillist  -  Tutor at python.org <mailto:Tutor at python.org>
>     To unsubscribe or change subscription options:
>     https://mail.python.org/mailman/listinfo/tutor
>     <https://mail.python.org/mailman/listinfo/tutor>
>
>
>
>
>
> ---------- Forwarded message ----------
> From: Brandon Anderson <brandonanderson at me.com>
> To: tutor at python.org
> Cc:
> Bcc:
> Date: Sun, 23 Jul 2017 16:19:41 -0700
> Subject: [Tutor] Python3 Help
> Hello!
>
> 1.      I have Python3 installed on my 2017 MacBook Pro. I know that it is
> successfully installed because, when I enter “Python3’ into my terminal,
>         I get the following message:
>
>         Python 3.6.2 (v3.6.2:5fd33b5926, Jul 16 2017, 20:11:06)
>         [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
>         Type "help", "copyright", "credits" or "license" for more
> information.
>
> 2.  I’m trying to locate the directory path to where Python3 is located on
> my system, but when I enter
>         the following command:
>         $ type -a python3
>
>         I get:
>         -bash: $: command not found
>
>         My understanding is that the command should have provided me with
> the path to Python3 is located on my system.
>
> 3.  How do I determine why I’m getting the ‘error’ command, instead of the
> directory location of Python3.
>     I need the location in order to setup my Text Editor to execute
> Python3 commands.
>
> Thank you in advance.
>
> Brandon Anderson
> (510) 468-0154
> brandonanderson at icloud.com
>
>
> ---------- Forwarded message ----------
> From: Michael C <mysecretrobotfactory at gmail.com>
> To: python tutor <tutor at python.org>
> Cc:
> Bcc:
> Date: Sun, 23 Jul 2017 13:24:49 -0700
> Subject: [Tutor] class newbie
> class mahschool:
>     def print():
>         print('Say something')
>
>
> a = mahschool()
>
> a.print()
>
>
>
> With this, I get this error:
>
> Traceback (most recent call last):
>   File "test.py", line 8, in <module>
>     a.print()
> TypeError: print() takes 0 positional arguments but 1 was given
>
>
> What did I do wrong?
>
> Thanks!
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> https://mail.python.org/mailman/listinfo/tutor
>
>


_______________________________________________
Tutor maillist  -  Tutor at python.org
https://mail.python.org/mailman/listinfo/tutor


More information about the Tutor mailing list