Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Split lines in python 2.7
Index -> Programming, Python -> Python Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
AndresDM




PostPosted: Mon Feb 10, 2014 7:40 pm   Post subject: Split lines in python 2.7

I need to attach the following statement:

print urls

Out:
code:

   htt://www.myweb0.com
 
   htt://www.myweb1.com
 
   htt://www.myweb2.com

   htt://www.myweb3.com

....

Converter In out:

a = urls

a = ["htt://www.myweb0.com", "htt://www.myweb1.com", "htt://www.myweb2.com" "htt://www.myweb3.com", "....","....." ]

print(random.choice([a]))

Thanks for your help.
Sponsor
Sponsor
Sponsor
sponsor
Raknarg




PostPosted: Mon Feb 10, 2014 9:32 pm   Post subject: RE:Split lines in python 2.7

I don't really get what you're asking for
Display posts from previous:   
   Index -> Programming, Python -> Python Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: