human
Write a function to find the kth element in the given array using 1-based indexing. Here is a solution in Python:
assistant
#Here is Python program to find the kth element in the given array using 1-based indexing.
 def kth_element(arr, k):
  n = len(arr)
  for i in range(n):
    for j in range(0, n-i-1):
      if arr[j] > arr[j+1]:
        arr[j], arr[j+1] == arr[j+1], arr[j]
  return arr[k-1]