0

why isn't this working here but works well on pc

tries = 0 answer = 'samsung' print('Let\'s play a guessing game, guess the name of my phone') while tries <= 3: tries = tries + 1 count = 3 - tries print('what is my phone name') guess = input() if guess == answer: print('you are correct') break elif tries == 3: print('No more tries, the answer is ' + answer) break else: print('try again, you have ' + str(count) + 'tries')

13th Sep 2016, 10:21 PM
oghenemavo
oghenemavo - avatar
4 ответов
+ 2
Cos this program does not take over the control from console for writing redirect. So you can't input anything with input() function while running. Actually all those codes running here is through steps bellow 1. Coding local 2. Send to remote server 3. Run there 4. Return the result from remote server 5. Display result local Thus when you using input() function it is prompting in remote computer not this app! That is why your code can't run abnormal here. While using in pic you have full control to run codes in local and get input stream of local. Hope this is helpful for you.
14th Sep 2016, 1:37 AM
looyea
0
What results do you expect and do you get instead? Please elaborate.
13th Sep 2016, 10:41 PM
trueneu
trueneu - avatar
0
it's suppose to print you are correct if the right answer is inputted and give the user three chances to get the correct answer after which the correct answer is displayed
13th Sep 2016, 10:46 PM
oghenemavo
oghenemavo - avatar
0
A test is close your inter net connection of your iPad or iPhone while your in code playground, and the run again, there is nothing happen
14th Sep 2016, 1:38 AM
looyea