Printing lists in python without spaces

前端 未结 7 672
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-12 16:47

I am doing a program that changes a number in base 10 to base 7, so i did this :

num = int(raw_input(\"\"))
mod = int(0)
list = []
while num> 0:
    mod =         


        
7条回答
  •  天涯浪人
    2021-01-12 17:40

    s = "jay"
    list = [ i for i in s ]
    

    It you print list you will get:

    ['j','a','y']

    new_s = "".join(list)
    

    If you print new_s:

    "jay"

提交回复
热议问题