Skip to content
Sign upLog in
← Back to Community
Why is there a "none" after everything typed?
Profile icon
RaptorFace

Why does it keep typing none?

Answered by JBloves27 [earned 5 cycles]
View Answer
Voters
Profile icon
LennoxBalch
Profile icon
RaptorFace
Comments
hotnewtop
Profile icon
JBloves27

aha, i had this error once as well. Something like it Anyways, so because you added the module emoji, and its not a real module, i cant find the exact error. But I have a guess. So the print("Welcome {}...")? Fix that. Instead of that, use print("Welcome {name}") that is much better and easier
I hope this helps!

Profile icon
RaptorFace

@JBYT27
I tried that just now and it doesn't work!

Profile icon
JBloves27

Umm, you have to put the brackets INSIDE the parentheses. without the comma. And add a f before the parentheses. lol. Heres what you have to do:

print(f"Welcome {name}")

That should work

@bohandong

Profile icon
RaptorFace

@JBYT27
Thanks for the info but how does this have to do with stopping it from printing "None"?

Profile icon
JBloves27

Well, I think your function/module command was wrong, or it just doesn't work. It also could be outdated

@bohandong

Profile icon
Coder100

where is this happening anyways

@bohandong

Profile icon
JBloves27

seems like its fixed

@Coder100

Profile icon
RaptorFace

@Coder100
on the blackboard thingy (where all the printed stuff goes)

Profile icon
Coder100

ah nice

@JBYT27

Profile icon
RaptorFace

yeah

Profile icon
JBloves27
Profile icon
RaptorFace

oh it is back again

Profile icon
JBloves27

ummm, i dont think so. Its ok for me

@bohandong

Edit: Seems like there is no such module called emoji

Profile icon
RaptorFace

@JBYT27
for me it shows

Profile icon
JBloves27

where? maybe try forking it and then try again?

@bohandong

Profile icon
JBloves27

Let me try forking it and ill invite you

@bohandong

Profile icon
JBloves27

I found the error. So a input cannot be a print, and you put cprint, which does not work with an input. So you have to take off the colors for it to work

@bohandong

Profile icon
RaptorFace

@JBYT27
what is it?

Profile icon
RaptorFace

@JBYT27
oh ok

Profile icon
JBloves27

So yeah, the errors fixed, you just want to change what RYANTADIPARTHI wants you to change pretty much. Glad I helped!

@bohandong

Profile icon
bhavreenkaur

hi im 9 i dont think i can help but Most of the python function raises TypeError if None is passed as an argument. Take any function say chr(None) and see it raises TypeError . This will prevent someone from passing you the wrong type, as well as dealing with the None issue. It will return an AssertionError , as per the docs.

Profile icon
tussiez

@bhavreenkaur
Hello there!
Unfortunately, if you are under the age of 13, I don't believe you can participate in Repl Talk.

Profile icon
RYANTADIPARTHI

Solution

i don't know what you mean by none. i just tried it, and nothing says none but you do have a ValueError. To fix this, remove the termcolor.colored(), you cannot use that with inputs.

while True: print(termcolor.colored("Enter the number that you want to do E.g 1 for addition...","yellow")) ask_questions = int(input("Do you want to do 1.+ 2.− 3.÷ 4.× 5. shop: ")) if ask_questions == 1: #add question 0 addition_questions = int(input(termcolor.colored("10 + 10 = ","yellow")))

like that. Once you do that, everything should work. There is no such thing called none in your output.
That should work

Profile icon
JBloves27

I think there was a none error. Its just

@bohandong
sees it still, but not us
@RYANTADIPARTHI

sry for pings

Profile icon
RaptorFace

@RYANTADIPARTHI
My part that says None is this part in the output:
staff:
Hi there! How can I help you?
Would you like to have a look at our items(y/n)?
None

Profile icon
RYANTADIPARTHI

@JBYT27
well, idk about that, but, maybe eventually I'll see it.

Profile icon
JBloves27
Profile icon
JBloves27

could you remove the emoji module and it's functions? because with it, we cant see the error at all

@bohandong

Profile icon
RYANTADIPARTHI

@bohandong
another error no module named emoji. i can't get to that part because of the error.

Profile icon
RaptorFace
Profile icon
RaptorFace

@RYANTADIPARTHI
I have deleted all emoji related things
and still appears (None)

Profile icon
RYANTADIPARTHI

@bohandong
ok, so before i can get to the none parts, you have that ValueError. I tell you how to solve it on my first comment.

Profile icon
RYANTADIPARTHI

@bohandong
read my first comment. You have to solve that error first.

Profile icon
RaptorFace

@RYANTADIPARTHI
Do you mean deleting every one of the inputs with the termcolor.colored?

Profile icon
RYANTADIPARTHI

@bohandong
yes. Also, if you want to be able to type shopin, you have to not put int, since it's a integer, and shop is a string.

Profile icon
RaptorFace

@RYANTADIPARTHI
No i just want to type the numbers

Profile icon
RYANTADIPARTHI

@bohandong
yes, then how will you type shop? shop is a string.

Profile icon
RaptorFace

@RYANTADIPARTHI
5 = shop i type 5 instead of shop

Profile icon
RYANTADIPARTHI

@bohandong
oh ok. Tell me how to get to the none part.

Profile icon
Coder100

wdym