Last active
June 29, 2017 01:02
-
-
Save onitonitonito/77f0080bf80a515f8286d9c48eb6ca7d to your computer and use it in GitHub Desktop.
Guess why? - looks a bit weird result.. describe WHY?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Two Different Results | |
# Compare #A-1 to #B-1 | |
# Guess why? thinking about join() function. | |
# board = [[ str(n) for n in range(7,12) ]] #A | |
board = [ str(n) for n in range(7,12) ] #B | |
print (board) | |
for t in board: | |
print('|'+'|'.join(t)+'|') #1 | |
# print('|'.join(t)+'|') #2 | |
# print(','.join(t)) #3 | |
# ''' | |
# #A-1 | |
# [['7', '8', '9', '10', '11']] | |
# |7|8|9|10|11| | |
# [Finished in 2.36s] | |
# | |
# #B-1 | |
# ['7', '8', '9', '10', '11'] | |
# |7| | |
# |8| | |
# |9| | |
# |1|0| | |
# |1|1| | |
# [Finished in 1.83s] | |
# | |
# Why #A-1 spent more time? | |
# ''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
L,i,f,e, ,i,s, ,S,h,o,r,t,,, ,Y,o,u, ,N,e,e,d, ,P,y,t,h,o,n
A,B,R,A,K,A,D,A,B,R,A
1,2,3,4,5
[1, 2, 3, 4, 5]
[,1,,, ,2,,, ,3,,, ,4,,, ,5,]
[#1#,# #2#,# #3#,# #4#,# #5#]
[Finished in 2.153s]