what is the reason why Python doesn't have switch statement ?
Rejinacm 0 Newbie Poster
Recommended Answers
Jump to Postwhat is the reason why Python doesn't have switch statement ?
Even in C the switch/case is not as efficient as multiple if/else and the cases are rather limited.
Actually, a dictionary makes an excellent replacement for a switch/case and is very high speed on the lookups:
All 3 Replies
BearofNH 104 Posting Whiz
Gribouillis 1,391 Programming Explorer Team Colleague
sneekula 969 Nearly a Posting Maven
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.