Python Challenge - Find Xth Number In Order

def getX(x, nums):

write your code here

nums_sorted = nums

If the input x is greater than the length of the list, or nums is empty, return 0.

if (nums == ) or (x > len(nums)):
xth_number = 0
else:
step = 1
while step <= x:
xth_number = nums_sorted[0]
for number in nums_sorted:
if xth_number > number:
xth_number = number
step += 1
nums_sorted.remove(xth_number)
return xth_number

print(getX(2, [6, 3, -1, 5]))