See my previous post with two queues,https://leetcode.com/discuss/40085/accepted-python-using-two-queues. I then noticed that size can be used and here is the one queue solution.

```
class Stack:
# initialize your data structure here.
def __init__(self):
self.q1=[]
# @param x, an integer
# @return nothing
def push(self, x):
self.q1.append(x)
# @return nothing
def pop(self):
lens=len(self.q1)
for i in range(lens-1):
tmp=self.q1.pop(0)
self.q1.append(tmp)
self.q1.pop(0)
# @return an integer
def top(self):
lens=len(self.q1)
for i in range(lens):
tmp=self.q1.pop(0)
self.q1.append(tmp)
return tmp
# @return an boolean
def empty(self):
if self.q1:
return False
return True
```