16. And Now, For Something Completely Familiar (a possible bug?)


#1



16. And Now, For Something Completely Familiar


Keep getting:

Traceback (most recent call last):
  File "python", line 3, in <module>
  File "<string>", line 1, in <module>
NameError: name 'test' is not defined

When typing any text, but code passes if I type any numbers


Code should pass after any "text type" input


# Write your code below, starting on line 3!

my_string = str(input("Enter str: "))
print len(my_string)
print my_string.upper()

UPD: Solution found, topic can be closed!


#2

input() will evaluate the input as code in python2, use raw_input (for other people reading this)


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.