import sys playercords = [10, 10] for a in range(10): for b in range(20): if(playercords[0] == a and playercords[1] == b): sys.stdout.write("A") else: sys.stdout.write("#") print("") 

It is necessary that at a certain moment the symbol A is output, but only this is output:

 #################### #################### #################### #################### #################### #################### #################### #################### #################### #################### 

Closed due to the fact that off-topic participants 0xdb , Suvitruf , ߊߚߤߘ , Jarvis_J , Grundy Aug 26 '18 at 10:51 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reasons:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - ߊߚߤߘ, Grundy
  • “Questions asking for help with debugging (“ why does this code not work? ”) Should include the desired behavior, a specific problem or error, and a minimum code for playing it right in the question . Questions without an explicit description of the problem are useless for other visitors. See How to create minimal, self-sufficient and reproducible example . " - 0xdb, Suvitruf, Jarvis_J
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • 2
    playercords [0] == a - always false, like the second. range (10) returns integers from 0 to 9 inclusive - MaxU
  • in general, everything is correct. you have a problem in the first cycle: a list is generated from 0 to 9, 10 is not inclusive. either increase the generator for the first cycle, or lower the first number in playercords - Konstantin Kozlenko
  • sys.stdout.write("A") -> print("A", end='') , print("") -> print() , if(playercords[0] == a and playercords[1] == b): -> if playercords[0] == a and playercords[1] == b: - gil9red

1 answer 1

If in your code to increase the size of the field in the line for a in range(11): from 10 to 11, then player A will appear:

 #################### #################### #################### #################### #################### #################### #################### #################### #################### #################### ##########A#########