I had to code this for my midterm in my programming class, this is just a small part of the code. keep in mind I'm really new to programming and this is an intro class to it.
we are learning 3.5 in class, and the code I wrote works fine in 3.5. however, I am starting to try and learn 2.7 and this code does not work on it:
print ("is student 1 here?")
attendence1 = input()
if attendence1 == "yes":
student1 = "Y"
if attendence1 != (str("yes")):
student1 = ("N")
I'm just curious as to what the problem is between versions, and how 3.5 reads it vs how 2.7 does. I noticed that if I entered in my answer in 2.7 as a string, it would work, i.e: Q:is student 2 here? A: "yes" does not cause an error, how ever Q:is student 2 here? A Yes causes it to give me
attendence1 = input()
File "<string>", line 1, in <module>
NameError: name 'yes' is not defined
How would I make this code work on 2.7?