Check yourself...some more (NEED HELP!)


#1

PLEASE help me with my code below.... it keeps telling me that i have accidentally deleted the variable called original!!....

Start coding here!

Original =raw_input("enter a word:")
if len(Original)> 0 and Original.isalpha():
print "Original"
else:
print "empty"


#2

Why are you printing Original as a string? It's not going to print what you typed.


#3

okay thanks!....even if i print what i want it to..it still gives the same error


#4

your Original variable doesn't need to be capitalized. The lesson wants it lowercased.


#5

Hey. I know the answer for your question. I faced the same problem today and I have found a solution.

Pay special attention to the line 3 in your code. You have to use the method isalpha() with the "original" variable while using "print". (e.g. print original.isalpha(): )

In your case, as well as it was in mine - the "original" will be the input from user and it will be outputted exactly like it was inputted till the moment you change conditions.

As I understood, Codecademy automated tests just compare your output with expected result. So it prints exactly what you've written at print part of your code.

Hope, I was helpful.


#6

i didnt really understand....sorry:(


#7

doesnt work even if its lower cased


#8

Please post an updated version of your code.


#9

raw_input("enter a word:")
original= raw_input
if len(original) > 0 and original.isalpha():
print "present"
else
print "empty"


#10

problem:

original, isnt holding what you input into it, it only holds raw_input. original should be holding what's in your first raw_input.

Also,

You want to print original, not just a string itself. The string will already be in original.

And:

You forgot a colon. Do you know where to place it?


#12

i m actually new to coding...will u pls show me exactly how my code should be


#13

That would be against the community guidelines... So, unfortunately, no.


#14

owww didnt know
sorry!!


#15

It's okay, I understand the feeling. But how would you learn if I just gave you the code? You are really close right now, just make the changes suggested by @intermediategamer and your code should work.


#16

this is my new code...it works nd in the console when i run it it shows enter a word: i enter and the error i wrote below shows

original= raw_input("enter a word:")
if len(original) > 0 and original.isalpha():
print "present"
else:
print "empty"

this is the error
It looks like your code does not print original ("suraj") when original is only made up of alphabetical characters.


#17

Alright, you are soooo close. The issue is, you are not printing original… Therefore, all you have to do is change this line:

print "present"

to this

print original

and your code should work (assuming you used proper indentation).


#18

thank u! it worked:)


#20

How do you know the .isalpha() part? That wasn’t covered in any section before, right?


#21

that is a very good question that I have myself.


#22

A post was split to a new topic: IndentationError: expected an indented block