Question from the Python - Fundamentals test

Write a Python function that takes two numbers as input and prints 'Along the x-axis' if the first number is not zero, 'Along the y-axis' if the second number is not zero, and 'Anywhere' otherwise.

Hard

What is the missing keyword in the following python code ?

<keyword> (x, y):
	case (x, 0):
		print('Along the x-axis')
	case (0, y):
		print('Along the y-axis')
	case _:
		print('Anywhere')
Author: ThéoStatus: PublishedQuestion passed 73 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!