Atomic mass :
K = 39.09 a.m.u
O = 15.99 a.m.u
number of moles:
K = 34.5 / 39.09 => 0.882 moles of K
O = 7.06 / 15.99 => 0.441 moles of O
Use the least number of moles obtained to get the formula empirical:
K = 0.882 / 0.441 => 2
O = 0.441 / 0.441 => 1
Therefore : K₂O
hope this helps!