# is digit prime? we will see (Coder: Chikak)
def is_prime(x):
flag = False
if x < 2:
return False
else:
for count in range(2, x):
if x % count == 0:
flag = True
break
if flag == True:
return False
return True
Write a version of the same operator overload, but give it a parameter of type int
. You don't have to do anything with that parameter's value.
If you're interested in some history of how this syntax was arrived out, there's a snippet of it here.
http://www.devx.com/tips/Tip/12515
class Date {
//...
public:
Date& operator++(); //prefix
Date& operator--(); //prefix
Date operator++(int unused); //postfix
Date operator--(int unused); //postfix
};
Postfix имеет аргумент int в подписи.
Class& operator++(); //Prefix
Class operator++(int); //Postfix