How to implement switch in python | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

How to implement switch in python

27th Jun 2018, 7:09 PM
sweta umrao
sweta umrao - avatar
3 Respostas
28th Jun 2018, 1:52 AM
$Ā¢šŽā‚¹š”­!šØš“
$Ā¢šŽā‚¹š”­!šØš“ - avatar
0
are you talking about something like in C++: switch var{ case 1: code to execute if var==1; case 2: code to execute if var==2; case 3: code to execute if var ==3; } ...then I am also interested in the answer. Switch is super helpful to avoid huge if...else chains, imo, but I didn't see it addressed in the basic python lesson.
27th Jun 2018, 11:30 PM
E. Smith
E. Smith - avatar