Hi All
I am trying to learn Python and cannot get aroud this problem for the life of me.
I have generated a sript as follows, called xandy.py
def xandy (x,y):
if x < y:
print x, "is less than", y
elif x > y:
print x, "is greater than", y
else:
print x, "and", y, "are equal"
I cannot get it to work in the shell?
>>> x=5
>>> y=4
>>> xandy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'xandy' is not defined
>>> xandy (5,4)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'xandy' is not defined
>>>
Thanks in anticipation
chico2009 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.