[Tutor] Help with scoping

2017-03-23 Thread Richard Mcewan
Hi Thanks Alan and all. I've incorporated your points. I've explored how values are returned and used by functions. I switched to Python to check a Swift3 bug and I think I can see a number of issues more clearly now. I put the count and call for next user guess back a tab at the end of the

[Tutor] Help with function scoping

2017-03-23 Thread Richard Mcewan
Hi Thanks Mats, Joel and Alan for helpful advice. This code (below) behaves as I wanted now. And think I see where I was going wrong with functions. Thank you very much. Richard Ps I'll reflect on appropriate variable names also. # coding: utf-8 import random #guess number game #compute

[Tutor] Help with function scoping

2017-03-22 Thread Richard Mcewan
Hi I wonder if you can help. I'm confused about how functions should work. Below is some code I write to check my understanding. I'm expecting two functions to be defined. Then called. One returns a random number. The other user input (guessing the number). I expect the return values to ac