Python - Indentation Error

Hello all -

Long shot, but I am having a heck of a time figuring out what I am doing wrong here. Any help would be greatly appreciated.

INSTRUCTIONS

In this program, you must ask the user:

“What is your name?”

And then respond by printing out a personalized greeting.

GENERAL RULE

For a person named Maria, respond by printing:

Hello Maria :slight_smile:

For a person named Wally, respond by printing:

Hello Wally :slight_smile:

…etc.

In general, for a person named , respond by printing:

Hello

SPECIAL NAMES

Two people are special: Amar and Brandy.

A person named Amar or Brandy should receive an additional comment after you say hello

For a person named Amar, respond by saying:

Hello Amar :slight_smile:

I like your shoes

For a person named Brandy, respond by saying:

Hello Brandy :slight_smile:

You seem like a cool person

Note that the robot grader will only mark your solution correct if your

print statements match EXACTLY what was specified above.

Spelling, spacing, punctuation… all that stuff matters.

Your input statement also matters. You must say it exactly like this:

What is your name?

Here is what I have so far, and I am getting an indentation error:

Put your Python code here:
name = input(“What is your name?”)
print(“Hello” ,name,":)")
for name in[“Brandy”]:
print(“you seem like a cool person”)
for name in[“Amar”]:
print(“I like your shoes”)

INSTRUCTIONS

For each number between 1 and 100…

If the number is odd, then simply print it out.

BUT if the number is even, then print the word “Steven” instead.

When I run your program, I should see the following output:

1

Steven

3

Steven

5

97

Steven

99

Steven

Note that you shold start at 1 (not 0), and that the 100 must be INCLUDED.

In other words, the last number should be 100, not 99.

--------------------------------------------------------------------

Thanks so much for your feedback!

For the first one, the code should look something like this:

https://repl.it/HAq6/0

Second one like this:

https://repl.it/HAqm/4

1 Like

That’s nice. I changed mine to reflect a more spelled out version of yours.

1 Like

Thanks for you help!
It didn’t quite work though. It is for Python 2.

It is for version 2.7

Just remove the parenthesis on the print statements:

https://repl.it/HAsR/0

For the first one you’ll have to have raw_input instead of input:

https://repl.it/HAsU/3

It worked.
Thank you!!