How to keep repeating a program until a specific input?
<p>I want to write a program to compute the average of a group of numbers entered (one at a time) by the user. Each group should end when the user enters the sentinel value '' (ENTER without input). Two consecutive sentinel values should quit the program. The number of each group should be displayed along side with their average:</p>

<p>This is my code :</p>

<pre><code>x = eval(input('Enter a number: '))
lis = []
while x != '':
    lis.append(x)
if x == '':
    avg = sum(lis) / len(lis)
print(avg)
</code></pre>