Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
list and for
#1
I'm new at python programing i read some basic and i have a question. Probably it is easy but i dont know how to do it. (im looking for answer for 2 days)

I have something like this

string="awesome cat";
str=string.split();

for i in str:
    print ('-'.join(i));
And if i print it i have
a-w-e-s-o-m-e
c-a-t

And my question is how i make each i into new string like this "a-w-e-s-o-m-e c-a-t"?

I know its easy but im very basic at programing so im sorry if i hurt anyone with my question.
Reply


Messages In This Thread
list and for - by Breex - Jun-18-2018, 07:56 PM
RE: list and for - by anickone - Jun-18-2018, 08:18 PM
RE: list and for - by volcano63 - Jun-18-2018, 08:27 PM
RE: list and for - by Breex - Jun-18-2018, 08:30 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020