Trouble with numbers and text in the same line (Python 3)
KrystanKlukos (1)

I've been using a code for awhile trying to get text and variables in the same line to print a sentence that depends mainly changing variables based on int(inuput) it doesn't work

You are viewing a single comment. View All
leon332157 (217)

@KrystanKlukos a = int(input())
b = a - 1
c = a + 1
d = "The next number for the number "
e = "is "
f = "The previous number for the number "
print('{}{}{}{}'.format(d, a ,e , b ))