2

I am trying to get two values from the user and print a line of text with the user input.

char1 = input("Please enter the first character: ")
char2 = input("Please enter the secound character: ")

width = int(input("Please enter the width of the innermost triangle: "))

if width % 2 == 0:
    print ("ERROR - number is even")
    quit()

print ("")
print (char1*11,char2*1,char1*11)

This is my current output:

YYYYYYYYYYY + YYYYYYYYYYY

I am trying to print it with no spaces so that it looks like this:

YYYYYYYYYYY+YYYYYYYYYYY

How do I do this?

Chris Martin
  • 30,334
  • 10
  • 78
  • 137
deebs
  • 21
  • 1
  • 6
    Possible duplicate of [Print without space in python 3](http://stackoverflow.com/questions/12700558/print-without-space-in-python-3) – idjaw Nov 08 '15 at 22:59

1 Answers1

1

Print your output like this:

print ("{}{}{}".format(char1*11,char2*1,char1*11))

or you can use sep if you are using Python 3:

print (char1*11,char2*1,char1*11, sep="")

Read some more about printing here:

http://www.python-course.eu/python3_print.php

idjaw
  • 25,487
  • 7
  • 64
  • 83