omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Adding characters to strings

    Pythonista
    slicing strings functions
    2
    2
    2063
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • craigmrock
      craigmrock last edited by

      Horrible at math (and probably Python) but trying to make a function that takes a word and adds an asterisk in between the letters. Trying with a 3 letter word, but the formula should handle any size word you give it.
      Here’s what I have:

      word=str(input('Give me a word: '))
      
      def starry_eyes(str):
      	while word == (''):
      		return ([],'*',[],'*',[])
      		```
      1 Reply Last reply Reply Quote 0
      • enceladus
        enceladus last edited by

        word = 'python'
        print('*'.join(word))
        
        1 Reply Last reply Reply Quote 1
        • First post
          Last post
        Powered by NodeBB Forums | Contributors