I am working in python and trying to solve this programming prompt:

You are provided with a list (or array) of integer pairs. Elements of each pair represent the number of people that get on the bus (the first item) and the number of people that get off the bus (the second item) at a bus stop.

Your task is to return the number of people who are still on the bus after the last bus stop (after the last array). 

Please keep in mind that the test cases ensure that the number of people in the bus is always >= 0. So the returned integer can't be negative.

The second value in the first pair in the array is 0, since the bus is empty in the first bus stop.

Here is my code I have

def number(bus_stops):
    for on, off in bus_stops:
        total = 0
        total += on
        total -= off
    return total

But it doesn't work. Can you tell me what is wrong with it?
system
main paythan main kaam kar rahaa hum or is programing prompt ko hal karne kii koshish kar rahaa hum:

aapako purnank jode kii ek suchi (yaa sarani) pradaan kii jaati he.prayek jodi ke tatv bas (pehle item) par milane vaale logon kii sankhya or bas stop par bas (duusare item) se utarane vaale logon kii sankhya kaa pratinidhitiv karte hai.

aapkaa kaary un logon kii sankhya ko waapas karnaa he jo antim bas stop (antim sarani ke baad) ke baad abhi bhi bas main hai.

kripaya dhyaan rakhen ki pareekshan ke maamle yah sunishchit karte hai ki bas main logon kii sankhya hameshaa> = 0. hoti he, isliye lautaa hua purnank nakaaratmak nahin ho saktaa he.

sarani main pehali jodi main doosraa maan 0 he, kyonki bas pehle bas stop main khaali he.

yahan meraa code he jo mere paas he

DEF number (BUS_STOPS):
    ke liye, bas_stop main band:
        kul = 0
        kul += par
        kul -= band
    kul vaapasi

lekin yah kaam nahin karata he.kya aap mujhe bataa sakate hai ki isamen kya galat he?
user
aapke code ke saath mudda yah he ki kul kaa aarambhikaran galat gunjaaish main he.jis tarah se code ab he, kul char ko prayek loop punrariti par shunya par set kiya jayega, is prakaar ise riset karnaa hoga.samasya ko thik karne ke liye, line "kul = 0" ko sthanantarit karen.yahan sanshodhit code he:

DEF number (BUS_STOPS):
    kul = 0
    ke liye, bas_stop main band:
        kul += par
        kul -= band
    kul vaapasi
assistant
<|system|>
</s>
<|user|>
main paythan main kaam kar rahaa hum or is programing prompt ko hal karne kii koshish kar rahaa hum:

aapako purnank jode kii ek suchi (yaa sarani) pradaan kii jaati he.prayek jodi ke tatv bas (pehle item) par milane vaale logon kii sankhya or bas stop par bas (duusare item) se utarane vaale logon kii sankhya kaa pratinidhitiv karte hai.

aapkaa kaary un logon kii sankhya ko waapas karnaa he jo antim bas stop (antim sarani ke baad) ke baad abhi bhi bas main hai.

kripaya dhyaan rakhen ki pareekshan ke maamle yah sunishchit karte hai ki bas main logon kii sankhya hameshaa> = 0. hoti he, isliye lautaa hua purnank nakaaratmak nahin ho saktaa he.

sarani main pehali jodi main doosraa maan 0 he, kyonki bas pehle bas stop main khaali he.

yahan meraa code he jo mere paas he

DEF number (BUS_STOPS):
    ke liye, bas_stop main band:
        kul = 0
        kul += par
        kul -= band
    kul vaapasi

lekin yah kaam nahin karata he.kya aap mujhe bataa sakate hai ki isamen kya galat he?</s>
<|assistant|>
aapke code ke saath mudda yah he ki kul kaa aarambhikaran galat gunjaaish main he.jis tarah se code ab he, kul char ko prayek loop punrariti par shunya par set kiya jayega, is prakaar ise riset karnaa hoga.samasya ko thik karne ke liye, line "kul = 0" ko sthanantarit karen.yahan sanshodhit code he:

DEF number (BUS_STOPS):
    kul = 0
    ke liye, bas_stop main band:
        kul += par
        kul -= band
    kul vaapasi</s>
