What does "none" at the end of printed program mean?

How to get rid of “none”?

Current behavior:

Desired behavior

Repl link:

def linje(antal):
  print(antal*"ㅡ")

antal=int(input("Ange antal: "))
print(linje(antal))

Hey @WilliamNilsen1 welcome to the forums!

I see your problem, you are printing multiple times with an input which can cause it to print none, you could use a return instead →

def linje(antal):
   return antal * "ㅡ"

antal = int(input("Ange antal: "))
print(linje(antal))

Or if you want to keep the print you can remove the second one →

def linje(antal):
   print(antal * "ㅡ")

antal = int(input("Ange antal: "))
linje(antal)

I hope this helps!

2 Likes