- 1
Why is this code not printing âDâ Pattern
for row in range(7): for col in range(5): if (col == 0 or col == 4 and row not in (0,6) or row in (0,6) and 0 < col < 4) : print("D", end=" ") else: print(end=' ') print() It should print âDâ. But it printing - **** ** ** ** ** ** ***
3 Respostas
+ 2
indent the else for one more space
+ 5
Balraj Singh , just a hint:
âȘïž try to use correct indentation width - 4 spaces are recommended. readability in code editor but more in Q&A will be much better. thanks!
+ 3
Write your code in Insert Code, because you should to click Enter after (:) (for loop) and (if statement)
https://code.sololearn.com/cQSNK1q9I1zc/?ref=app