I have two informations (number of men and number of women) and I would like to store them in the same of the named (population):

nb_femme=soup.find_all("text", {"class" : "p8_segmentMainLabel-outer"})
nb_homme=soup.find_all("text", {"class" : "p8_segmentValue-outer"})
for Data in list(zip(nb_femme,nb_homme)):
    try:
        nb_femme,nb_homme = Data
        nb_femme=nb_femme.string.encode('utf-8') # number of women
        nb_homme=nb_homme.string.encode('utf-8') # number of men
        print ' = '.join([nb_femme,nb_homme])
    except NavigableString: 
        pass

I want a result like this :

-----------------
| Population    |
-----------------
|Men = 35442    |
|Women = 41405  |
-----------------

Any help would be appreciated.



Source link https://sqa.stackexchange.com/questions/34584/how-to--two-value-in-same-row-csv-with-

LEAVE A REPLY

Please enter your comment!
Please enter your name here