user-input

A problem with the user input during the random forest classifier demonstration

A problem with the user input during the random forest classifier demonstration Question: I got over 90% accuracy with the Random Forest classifier, but I worry the rest of the algorithms give much lower results: A table with the results But this is not the main concern. The problem is that when I used user …

Total answers: 1

print is returning an address instead of a value

print is returning an address instead of a value Question: I’m new to python and i’m trying to print this function but it just shows the address of the function. def eligible(age, lingo, language): return "Eligible!" if(int(age) in range(25, 46)) and (lingo==’ingles’) and (language==’python’) else "Not Eligible!" age=input("What’s your age?: ") language=input("What language do you …

Total answers: 3

ValueError: invalid literal for int() with base 10: 'quit'

ValueError: invalid literal for int() with base 10: 'quit' Question: I keep getting this errror message: ValueError: invalid literal for int() with base 10 Here is my code snippet age = {} while age != ‘quit’: age = input(‘what is your age?’) age = int(age) if age >= 18: print("You’re old enough to vote.") else: …

Total answers: 1

Why do I need to input 'q' more than once to quit the while loop?

Why do I need to input 'q' more than once to quit the while loop? Question: I am making a text-based menu and wanted to have the program end when the letter ‘q’ is inputted however I need to do it more than once (2 or 3, I am not sure why it can be …

Total answers: 1