In the following program, why is the count function failing? I'M getting an error that it needs at leat one argument and that I have given it 0. I have here count(number), how is number no an argument? According to the documentation the start and end points are optional. I figured that just giving one argument, the whole string, would give me the count on the whole thing by default and thats what the documentation suggested to me.
#!/usr/bin/python3 import sys while(str.isdigit(sys.argv) == True): number = sys.argv print(number) print(str.count(str(number))) exit print("Input was not a number ", "formate as this -> ", sys.argv, " 123")
Edited 3 Years Ago by lewashby