a=x.title() + ' '
b=y.title() + ' '
nam = a + b + c
f = int(num)
print("\nSorry you must be at least 18 years to continue")
def p_details(self,cc): #need to print all detals by calling this method.
print("Name :" + self.nam )
print("Age :" + self.f)
print("Country :"+ con)
a = raw_input("Enter the first name :")
b = raw_input("Enter the middle name :")
c = raw_input("Enter the last name :")
num = raw_input("Enter the age :")
if(inp.age(num) == 1 ):
con = raw_input("\nPlease enter your country :")
class boy(): def __init___(self, num): self.age = int(num) num = raw_input("Enter the age :") inp = boy(num) if inp.age < 18: ....
Your class should work like this. The way you wrote it,
inp has no age attribute to evaluate. But as pointed out in the comments, there's really a lot wrong with your code there. The way you're using methods suggests you aren't clear on how classes and methods work, exactly. Also, getting user input opens up a whole host of issues - like what happens if the user doesn't enter a numeral when asked, and instead types, say, "old enough"?