A simple IF statement in python
<p>I'm having trouble getting an "Else" statement to work.</p>

<p>My code looks like this so far:</p>

<pre><code>roomNumber = (input("Enter the room number: "))

def find_details(id2find):
    rb_text = open('roombookings2.txt', 'r')
    for line in rb_text:
        s = {}
        (s['Date'], s['Room'], s['Course'], s['Stage']) = line.split(",")
        if id2find == (s['Room']):
            yield(s)
        rb_text.close()


for room in find_details(roomNumber):
    print("Date: " + room['Date'])
    print("Room: " + room['Room'])
    print("Course: " + room['Course'])
    print("Stage: " + room['Stage'])
</code></pre>

<p>So when i do a positive search and get multiple matches in my text file, i get well organised results.</p>

<p>However, i'm trying to get it to tell me if invalid input data is entered and re-ask for the room number until the correct data is input.</p>

<p>I tried using an "Else" statement about the "Yield(s)" but it wont accept it.
Any ideas?</p>
