<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<br> <BR><div id="SkyDrivePlaceholder"></div><div>> To: tutor@python.org<br>> From: alan.gauld@btinternet.com<br>> Date: Tue, 23 Oct 2012 23:46:23 +0100<br>> Subject: Re: [Tutor] blackJack problem<br>> <br>> Matthew Dalrymple <computer_dude15@hotmail.com> writes:<br>> <br>> > I thought by having a value outside<br>> > of the functions made the value global. <br>></div><div> </div><div>ok...is there an easier way to write this? the reason i was calling that global value the same as the currentBet is because i need to add that value to 5...I have to start at 1000 and if i win add 5 and if i lose subtract 5 and store that value. I have been staring at this stuff for like 3 hours :/ and still cant get even a slight idea as of what should work</div><div><br>> Not quite.<br>> To change the global value in a function you also need to declare it as<br>> global inside the function. Otherwise it will create a new local<br>> variable that has no effect on the global one.<br>> <br>> Also by declaring a parameter of your function with the same name as the<br>> global you confuse things. Don't do that.<br>> <br>> <br>> Am i somewhat on the right track?<br>> >  <br>> > any help would be appriciated...<br>> >  <br>> > Oh i also forgot to mention that even though im not using all the parameters<br>> > they have to be there because the professor wants to be able to run other<br>> > peoples "player1.py" files on my game.<br>> <br>> Interesting concept. And if the other peoples files are calling your<br>> functions with values in those parameters you will just ignore them I<br>> presume? Hmmm, that should produce some interesting results...<br></div><div>it should work in theory correct?</div><div><br>> -- <br>> Alan G<br>> Author of the Learn to Program web site<br>> http://www.alan-g.me.uk/<br>> Playing with gnus and possibly screwing it up!!<br>> <br>> _______________________________________________<br>> Tutor maillist  -  Tutor@python.org<br>> To unsubscribe or change subscription options:<br>> http://mail.python.org/mailman/listinfo/tutor<br></div>                                           </div></body>
</html>