Hi there, I am trying to code in my IDLE. However, I am not able to figure out how to pass correctly all the string arguments to my code. Any help will be greatly appreciated.
Thank you
-
import sys
-
def ShortestLen (valor):
-
shortestL = len (min (valor, key = len))
-
return int (shortestL)
-
valor = str (sys.argv[1:])
-
valoradj = valor.strip(’ ')
-
numeroletras = ShortestLen (valor)
-
resultado = [palabraf.upper() for palabraf in valoradj if len (palabraf) == numeroletras]
-
print (“The shortest word is”, resultado [0])