<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div><span>Thanks. I got it working.</span></div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"><font face="Arial" size="2"> On Monday, October 17, 2016 10:02 PM, Joshua Krasnow <jmk1@fastmail.fm> wrote:<br></font></div> <br><br> <div class="y_msg_container">1) try running it iPython<br clear="none"><br clear="none">2) why is the golf dict global? Why not just golf = {}? Also there's a<br clear="none">typo when writing the dict: s/gofl/golf<br clear="none"><br clear="none">On 10/17/2016 09:16 PM, Michael W. Hall wrote:<br clear="none">> Yep. Not really a good example I can find.<br clear="none">><br clear="none">> On Mon, 2016-10-17 at 21:01 -0500, Chris Brightwell wrote:<br clear="none">>> Did you try googling the error?<br clear="none">>><br clear="none">>>> On Oct 17, 2016, at 8:47 PM, Michael W. Hall <<a href="mailto:hallmw@att.net" shape="rect" ymailto="mailto:hallmw@att.net">hallmw@att.net</a>><br clear="none">>>> wrote:<br clear="none">>>><br clear="none">>>> Trying to help a friend. I am getting an error on the following<br clear="none">>>> program.<br clear="none">>>><br clear="none">>>> global golf{}<br clear="none">>>> name = ""<br clear="none">>>> while name != 1:<br clear="none">>>> name = input("Golfer's name? ")<br clear="none">>>> score = input("Golfer's score? ")<br clear="none">>>> golf[name]=score<br clear="none">>>><br clear="none">>>> file = open("","w")<br clear="none">>>><br clear="none">>>> for key in golf:<br clear="none">>>> file.write(key, gofl[key])<br clear="none">>>><br clear="none">>>> file.close()<br clear="none">>>><br clear="none">>>> golf is supposed to be a dictionary, but I am getting an error on<br clear="none">>>> the<br clear="none">>>> first line.<br clear="none">>>><br clear="none">>>> Any ideas?<br clear="none">>>> _______________________________________________<br clear="none">>>> LUNA mailing list<br clear="none">>>> <a href="mailto:LUNA@lunagroup.us" shape="rect" ymailto="mailto:LUNA@lunagroup.us">LUNA@lunagroup.us</a><br clear="none">>>> <a href="http://lunagroup.us/mailman/listinfo/luna" target="_blank" shape="rect">http://lunagroup.us/mailman/listinfo/luna</a><br clear="none">>> -------------- next part --------------<br clear="none">>> An HTML attachment was scrubbed...<br clear="none">>> URL: <<a href="http://lunagroup.us/pipermail/luna/attachments/20161017/e793e5c" target="_blank" shape="rect">http://lunagroup.us/pipermail/luna/attachments/20161017/e793e5c</a><br clear="none">>> 2/attachment.html><div class="yqt6133026359" id="yqtfd13546"><br clear="none">>> _______________________________________________<br clear="none">>> LUNA mailing list<br clear="none">>> <a href="mailto:LUNA@lunagroup.us" shape="rect" ymailto="mailto:LUNA@lunagroup.us">LUNA@lunagroup.us</a><br clear="none">>> <a href="http://lunagroup.us/mailman/listinfo/luna" target="_blank" shape="rect">http://lunagroup.us/mailman/listinfo/luna</a><br clear="none">> _______________________________________________<br clear="none">> LUNA mailing list<br clear="none">> <a href="mailto:LUNA@lunagroup.us" shape="rect" ymailto="mailto:LUNA@lunagroup.us">LUNA@lunagroup.us</a><br clear="none">> <a href="http://lunagroup.us/mailman/listinfo/luna" target="_blank" shape="rect">http://lunagroup.us/mailman/listinfo/luna</a><br clear="none"><br clear="none"><br clear="none">_______________________________________________<br clear="none">LUNA mailing list<br clear="none"><a href="mailto:LUNA@lunagroup.us" shape="rect" ymailto="mailto:LUNA@lunagroup.us">LUNA@lunagroup.us</a><br clear="none"><a href="http://lunagroup.us/mailman/listinfo/luna" target="_blank" shape="rect">http://lunagroup.us/mailman/listinfo/luna</a><br clear="none"></div><br><br></div> </div> </div> </div></div></body></html>