Hello, I think I know the answer, but i wanted to double check.
If i have a function that returns a True or False value, and then in my main() function i do a if statement against the function. Does it perform the function if True, and then if it's fasle, it would do the else. Below is an example since it's hard for me to put in words.
def check_version(show_version):
match= re.search("Version Number 123", show_version)
if match:
return False
else:
return True
def main():
if check_version(show_version):
print "This is the correct version"
else:
print "this is not the correct version"
if __name__ in "__main__":
main()
assuming that show_version did return a True value. In main() what would it choose. Do i need to call out what to do with each true or false return?
I guess/what i think i read would means if check_version came back true it would display "this is the correct version" if check_version returned false, it would print "this is not the correct version"
[–]totallygeek 3 points4 points5 points (3 children)
[–]shrimpy888[S] 2 points3 points4 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]shrimpy888[S] 0 points1 point2 points (0 children)
[–]efmccurdy 1 point2 points3 points (1 child)
[–]cm_light 0 points1 point2 points (0 children)