简体   繁体   中英

My code isn't returning in IntelliJ python. why isn't it returning? I know there's a basic reason why

How can i get this code to run in Intellij my run code only displays:

/usr/local/bin/python3.7 /Users/name/Downloads/untitled3/.idea/python.py

Process finished with exit code 0

using the print statement running the code

 board = ["-","_","-",
     "_","-","_",
     "-","_","_"] 

 def display_board():
   print(board[0] + "|" + board[1] + "|" + board[2])
   print(board[3] + "|" + board[4] + "|" + board[5])
   print(board[6] + "|" + board[7] + "|" + board[8])

print(display_board)

I want to see my work in run mode of Intellij

First of all, you maybe want to actually execute display_board with display_board() inside print(display_board) .

After that, i assume you dont actually need the print for the display_board call, so display_board() should be enough.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM