Jestem bardzo nowy python i szuka sposobu, aby uprościć następujące:Python - ułatwiają powtarzane if
if atotal == ainitial:
print: "The population of A has not changed"
if btotal == binitial:
print: "The population of B has not changed"
if ctotal == cinitial:
print: "The population of C has not changed"
if dtotal == dinitial:
print: "The population of D has not changed"
Oczywiście _Total i _initial są predefiniowane. Z góry dziękuję za pomoc.
Witam! Niewielki punkt; nie zapomnij swoich dwukropków na końcu instrukcji "if". Dobrze się szybko zinternalizować. – FarmerGedden