I heard several times that coding like this is suboptimal:
if weapon == "sword": print("Knight") elif weapon == "katana": print("Samurai") elif weapon == "axe": print("Viking")
How do I write such code optimally?
Aucun commentaire:
Enregistrer un commentaire