So, i have recently started learning python...i am writing a small script that pulls information from a csv and i need to be able to notify a user of an incorrect input
for example
the user is asked for his id number, the id number is anything from r1 to r5 i would like my script to be able to tell the user that they have input something wrong for example, if the user inputs a1 or r50, the user needs to be notified that they have input the wrong parameters. how do i do this?
i have looked into def statements, but i cannot seem to grasp all the syntax in python....(i dont know all the commands...parameters and stuff)
any help would be very much appreciated =D
while True:
import csv
DATE, ROOM, COURSE, STAGE = range (4)
csv_in = open("roombookings.csv", "rb")
reader = csv.reader (csv_in)
data = []
for row in reader:
data.append(row)
roomlist = raw_input ("Enter the room number: ")
print "The room you have specified has the following courses running: "
for sub_list in data:
if sub_list[ROOM] == roomlist:
Date, Room, Course, Stage = sub_list
print Date, Course