Why? does this happen? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Why? does this happen?

Hello, this is my code, its a part of a tic-tac-toe game, And why doesnt it print the "I am here"? Cells = ['x', 'x', 'o', 'o', 'x', 'o', 'o', 'x', 'x'] x = "x" o = "o" n = "0" D = "=" def whoWon(): if Cells == ['x', 'x', 'x', '', '', '', '', '', ''] or \ Cells == ['x', '', '', '', 'x', '', '', '', 'x'] or \ Cells == ['', '', 'x', '', 'x', '', 'x', '', ''] or \ Cells == ['', '', '', 'x', 'x', 'x', '', '', ''] or \ Cells == ['', '', '', '', '', '', 'x', 'x', 'x'] or \ Cells == ['x', '', '', 'x', '', '', 'x', '', ''] or \ Cells == ['', 'x', '', '', 'x', '', '', 'x', ''] or \ Cells == ['', '', 'x', '', '', 'x', '', '', 'x']: return x if Cells == ['o', 'o', 'o', '', '', '', '', '', ''] or \ Cells == ['o', '', '', '', 'o', '', '', '', 'o'] or \ Cells == ['', '', 'o', '', 'o', '', 'o', '', ''] or \ Cells == ['', '', '', 'o', 'o', 'o', '', '', ''] or \ Cells == ['', '', '', '', '', '', 'o', 'o', 'o'] or \ Cells == ['o', '', '', 'o', '', '', 'o', '', ''] or \ Cells == ['', 'o', '', '', 'o', '', '', 'o', ''] or \ Cells == ['', '', 'o', '', '', 'o', '', '', 'o']: return o for i in Cells: if i == '': return n else: print("I am here") Hope you can help me.

12th Nov 2017, 11:29 AM
DarkHorrorOfThirdEye
DarkHorrorOfThirdEye - avatar
3 Answers
0
Oops, Looks like i forgot to call my function! thats why i got blank when run, thx everyone!
12th Nov 2017, 12:37 PM
DarkHorrorOfThirdEye
DarkHorrorOfThirdEye - avatar
+ 2
Can you run thay in a code and explain what is the returned Error message?
12th Nov 2017, 11:34 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 1
There is no error message, it is blank when run, i don't know why it doesn't print.
12th Nov 2017, 11:36 AM
DarkHorrorOfThirdEye
DarkHorrorOfThirdEye - avatar