Re: [Tutor] Questions (and initial responses) on using version control: Why cannot I push my single (master) branch to origin without an error occurring?

2015-05-02 Thread boB Stepp
On Sat, May 2, 2015 at 3:15 AM, Albert-Jan Roskam wrote: > Check out this page: > http://stackoverflow.com/questions/7861184/what-is-the-difference-between-git-init-and-git-init-bare > > Isn't the error you mentioned before the same? After reading everything on the page you link to, plus the lit

Re: [Tutor] python dictionaries (copy by reference or copy by value?)

2015-05-02 Thread Steven D'Aprano
On Sat, May 02, 2015 at 04:25:41PM -0700, Alex McFerron wrote: > trying to understand why this is true [...] > question: if y=x from step 2 (the copy job) is just creating a pointer y > that points to the same thing as x then why when i set x = {} in step 5 > does that also not cause y to equal {}

Re: [Tutor] python dictionaries (copy by reference or copy by value?)

2015-05-02 Thread Ben Finney
Alex McFerron writes: > trying to understand why this is true > > step 1: x = {} Assignment; binds a reference (the name ‘x’) to a newly-created empty dictionary. > step 2: y = x Assignment; binds a reference (the name ‘y’) to the object currently referred to by ‘x’. That's the same object as

Re: [Tutor] python dictionaries (copy by reference or copy by value?)

2015-05-02 Thread Alan Gauld
On 03/05/15 00:25, Alex McFerron wrote: step 1: x = {} step 2: y = x step 3: x['key'] = 'value' # at this point if i print x or y i see {'key', 'value'} step 4: x['key'] = 'newValue' #and at this point printing x or y i see {'key', 'newValue'} and this is true if this was y['key'] because of t

[Tutor] python dictionaries (copy by reference or copy by value?)

2015-05-02 Thread Alex McFerron
trying to understand why this is true step 1: x = {} step 2: y = x step 3: x['key'] = 'value' # at this point if i print x or y i see {'key', 'value'} step 4: x['key'] = 'newValue' #and at this point printing x or y i see {'key', 'newValue'} and this is true if this was y['key'] because of the b

Re: [Tutor] Newbie problems

2015-05-02 Thread Sibylle Koczian
Am 02.05.2015 um 09:58 schrieb Alan Gauld: I made no mention of green because it is not a tuple. Can you see why 'in' is not the right test for green. Can you see why the interpreter is complaining? *This is what I programmed:* number = int(input('Enter a number between 0 and 36: ')) green_nu

Re: [Tutor] Having Unusual results

2015-05-02 Thread Dave Angel
On 05/02/2015 04:36 AM, Peter Otten wrote: Jag Sherrington wrote: With that the calculation becomes buns = 20 package_size = 8 whole_packages, missing_buns = divmod(buns, package_size) total_packages = whole_packages if missing_buns: total_packages += 1 ... total_packages 3 And that can b

[Tutor] Fwd: Re: Having Unusual results

2015-05-02 Thread Alan Gauld
CCing the list. Please use Reply ALL to include the list. On 02/05/15 10:58, Jag Sherrington wrote: Hi Alan thank you for your help have done what you sugested and still the results don't add up? # how many hot dogs left dogsleft = (packdogs * 10 and - dogs_needed) You removed the comma. B

Re: [Tutor] Newbie problems

2015-05-02 Thread Dave Angel
1) Please reply-list, or if your email program doesn't support that, do a reply-all. The idea is to make sure tutor@python.org is in your To: field. Otherwise you're just leaving private messages, and that's not what a public forum like this is about. 2) Please use text email, not html. As

Re: [Tutor] Having Unusual results

2015-05-02 Thread Peter Otten
Jag Sherrington wrote: > Hi Can anyone tell me where I am going wrong the end result doesn't add > up? Leaving out the Python side for a moment let's look again at one part of your problem: You need 20 buns. There are 8 buns in a package. How many packages do you need? You could say 2.5 becau

Re: [Tutor] Questions (and initial responses) on using version control: Why cannot I push my single (master) branch to origin without an error occurring?

2015-05-02 Thread Albert-Jan Roskam via Tutor
- On Sat, May 2, 2015 6:19 AM CEST boB Stepp wrote: >On Fri, May 1, 2015 at 1:41 PM, Albert-Jan Roskam wrote: >> >> >> On Fri, May 1, 2015 5:39 AM CEST boB Stepp wrote: >> >>I created my remote repository on, say my C-drive, with "git init

[Tutor] Fwd: Re: Pythonic review (descriptors)

2015-05-02 Thread Alan Gauld
Always reply using Reply ALL to include the tutor list members. On 02/05/15 05:34, Sage Hack wrote: Hi, thanks for checking the code. I'm trying to figure all your comments and update my code properly. On 28/04/15 10:21 AM, Alan Gauld wrote: https://github.com/SageHack/cloud-buster/tree/mast

Re: [Tutor] Newbie problems

2015-05-02 Thread Alan Gauld
Please use ReplyAll to include everyone on the the list. On 02/05/15 03:26, Jag Sherrington wrote: Hi Alan Thanks for your help. I followed your instruction and get the following message: Enter a number between 0 and 36: 9 Traceback (most recent call last): File "C:\Python34\Tests\Roulette_w

Re: [Tutor] Having Unusual results

2015-05-02 Thread Steven D'Aprano
On Sat, May 02, 2015 at 04:12:40AM +, Jag Sherrington wrote: > Hi Can anyone tell me where I am going wrong the end result doesn't add up? Hi Jag, it's hard to say exactly what's going wrong because you're posting with "Rich Text" that ends up mangling the formatting of your code something h

Re: [Tutor] Having Unusual results

2015-05-02 Thread Alan Gauld
On 02/05/15 05:12, Jag Sherrington wrote: Hi Can anyone tell me where I am going wrong the end result doesn't add up? I assume you are posting in HTML, your code is very hard to read with missing newlines. Please check your settings and post in plain text. I'm not sure what you mean by "does

Re: [Tutor] Creating an email option in Python

2015-05-02 Thread Ben Finney
Michael Lemon writes: > I'm a beginner in Python Welcome! You have chosen a great language for learning. > and I wanted to know how to create an email optional field using Python. Without knowing more about what that means, I'm not sure I would know how either :-) What is an “email optional f

Re: [Tutor] Having Unusual results

2015-05-02 Thread Ben Finney
Jag Sherrington writes: > Hi Can anyone tell me where I am going wrong the end result doesn't > add up? Maybe. first, though, you'll need to turn off any “rich text” or other fancy mangling of your message content. It makes the text undecipherable. Just compose your message as plain text, and p

[Tutor] Creating an email option in Python

2015-05-02 Thread Michael Lemon
I'm a beginner in Python and I wanted to know how to create an email optional field using Python. Michael ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Having Unusual results

2015-05-02 Thread Jag Sherrington
Hi Can anyone tell me where I am going wrong the end result doesn't add up? people = int(input('Enter how many people '))numdogs = int(input('Enter how many dogs ')) hotdogs = 10buns = 8dogsleft = 0bunsleft = 0 # total number of hot dogs neededdogs_needed = (numdogs * people) # how many packages o