python if statement jumping to the solution without even taking any imput

Viewed 30

hi im writing this code to hash files and strings, so in the main file im using this script to make the user choose between the commands (in separate files) but the condition starts automatically the hash_file.hash_file() without even asking for a input

import hash_file
import hash_text
command = input('what do you want to hash a file or a text?\n')
if command in ["file"]:         #mette a schermo
        hash_file.hash_file()
if command in ["text"]:
        hash_text.hash_text()
print(command)
0 Answers
Related