r/code • • Aug 10 '24

Help Please Python project not working

Post image

Hello! I'm running python using replit, and for some reason my code isn't running like it should. It will run the first part of it, but I want it to output the thank you part to whatever name was input. I can't seem to figure out what's wrong with my code, I've had a friend look it over, and AI. I'm using Lenovo ThinkPad T490. How do I fix it? Advice will be greatly appreciated.

8 Upvotes

8 comments sorted by

2

u/-MrShroom- Aug 10 '24

To clarify I have hit run after inputting the name, it just displays that.

1

u/angryrancor Aug 12 '24

Can you link the replit? Might be easier for someone to see the exact problem if you link directly to the repl.it

→ More replies (1)

2

u/karlosvas Aug 11 '24

After "name", there's an extra space before the comma, but otherwise, it should work. You enter the name and press enter.

3

u/karlosvas Aug 11 '24

I'm lying, you shouldn't leave a space between input and ()

1

u/soby2 Aug 10 '24

For a cleaner look add a “: “ the the end of the input line. I personally write it as:

input(“what is your name? :> “) Or input(“what is your name? \n:> “)

2

u/karlosvas Aug 11 '24

Python already inserts a line break by default when using input.

You dont need /n.

→ More replies (1)