```
#Checking Of Class
#N BLOCK
if eqid == "N001":
    class_ = "N001"
    print ("Class selected: "+class_)
    continue

if eqid == "N002":
    class_ = "N002"
    print ("Class selected: "+class_)
    continue

if eqid == "N003":
    class_ = "N003"
    print ("Class selected: "+class_)
    continue

if eqid == "N004":
    class_ = "N004"
    print ("Class selected: "+class_)
    continue

#E BLOCK
if eqid == "E001":
    class_ = "E001"
    print ("Class selected: "+class_)
    continue

if eqid == "E002":
    class_ = "E002"
    print ("Class selected: "+class_)
    continue

if eqid == "E003":
    class_ = "E003"
    print ("Class selected: "+class_)
    continue

if eqid == "E004":
    class_ = "E004"
    print ("Class selected: "+class_)
    continue

```

I have at least another 6 more 'blocks' to do so at least another ~30 classes, how could I make this more simple and not so long? I have tried having `eqid == class_` but that doesn't suit my needs as `eqid` is then exported into a CSV file and I don't wan't any of the 'classes' imported into the CSV file. 

`eqid = str.upper(raw_input('Please swipe your card: '))` 

That is where I get eqid from.

```
#CSV Writer
    ofile = open('Attendance.csv', "a")
    writer = csv.writer(ofile, delimiter=',')
    writer.writerow([eqid, period+1, clcode, attendance]) 
    ofile.close()

```

This is the CSV writer and the whole script is in a while loop.

```
import csv
import datetime
import os

while (1):
    #Defaults
    class_ = "N004" #If no class is specified it is defaulted to N004

    #Magnetic Card Reader Output & Attendance (Default = 0)
    attendance = '0'
    eqid = str.upper(raw_input('Please swipe your card: '))

    #Checking Of Class
    #N BLOCK
    if eqid == "N001":
        class_ = "N001"
        print ("Class selected: "+class_)
        continue

    if eqid == "N002":
        class_ = "N002"
        print ("Class selected: "+class_)
        continue

    if eqid == "N003":
        class_ = "N003"
        print ("Class selected: "+class_)
        continue

    if eqid == "N004":
        class_ = "N004"
        print ("Class selected: "+class_)
        continue

    #E BLOCK
    if eqid == "E001":
        class_ = "E001"
        print ("Class selected: "+class_)
        continue

    if eqid == "E002":
        class_ = "E002"
        print ("Class selected: "+class_)
        continue

    if eqid == "E003":
        class_ = "E003"
        print ("Class selected: "+class_)
        continue

    if eqid == "E004":
        class_ = "E004"
        print ("Class selected: "+class_)
        continue

    #Day & Time Checker
    format = "%H%M%S"
    format_ = "%H%M"
    today = datetime.datetime.today()
    s = today.strftime(format) #Time in 24hour
    s2 = today.strftime(format_)
    d = datetime.datetime.today().weekday() #Day of week (0-5)
    period = 0 #If they scan it outside of the dedicated periods it defaults to period 1

    #Period Checker
    if "084500" < s < "094000":
        period = 0
    if "094000" < s < "104000":
        period = 1
    if "112000" < s < "121500":
        period = 2
    if "121500" < s < "131500":
        period = 3
    if "133500" < s < "143000":
        period = 4

    #Class Code Reader
    dataList = []
    with open('J:/attendance/Timetables/'+class_+'.csv', 'r') as csvfile:
      csvreader = csv.reader(csvfile)
      for row in csvreader:
         dataList.append(row)
    csvfile.close()

    #Class Code
    clcode = dataList[period][d] 

    #CSV Writer
    ofile = open('Attendance.csv', "a")
    writer = csv.writer(ofile, delimiter=',')
    writer.writerow([eqid, period+1, clcode, attendance]) 
    ofile.close()

```

TL;DR: how would I go about simplifying my `Checking Of Class` script.

Thank you