So I'm learning about classes. Why can't I use the third block of code to do the same thing that the second block of code apparently does? Why do I have to assign p1 to person()and not just use person() in the way I do in the third block of code?
#class
class person:
def asdf(self):
self.firstname=""
self.lastname=""
self.id=""
self.email=""
self.friends=[]
#second block of code
p1 = person()
p1.firstname="Dave"
p1.lastname="Johnson"
p1.id="2345239"
p1.email="[email protected]"
print p1.firstname
#third block of code
person().firstname="Dave"
person().lastname="Johnson"
person().id="2345239"
person().email="[email protected]"
print person().firstname