Robotics & Artificial Intelligence
In Python, an 'if-elif-else' can be used to implement the 'switch-case' paradigm.
Related Questions
Check that the following code snippet will execute properly or not. Justify your answer.
a=10 b=25 if a<b: print("a is less than b") else: print("b is less than a")What would be the output of following code snippet:
a = [1, 2, 3, 4, 5] b = [2, 2, 2, 2, 2] for i in a: for j in b: k=i+j print(k)In Python, 'elif' and 'else' can be used interchangeably.
The 'while' loop is suitable to iterate sequence data type.