0
    a = int(input('enter a number :'))
    b = i+1
    print('your number + 1 = {b}')

I get back the following:

    enter a number :

after i enter a number print following text

    your number + 1 = {b}
Parsa
  • 1
  • 3
  • 1
    Does this answer your question? [Concatenating string and integer in Python](https://stackoverflow.com/questions/11559062/concatenating-string-and-integer-in-python) – Derenir Apr 12 '22 at 10:55

1 Answers1

2

You want a f-string for formatted string:

a = int(input('enter a number :'))
b = i+1
print(f'your number + 1 = {b}')

which needs to be prefixed with an f before the quote marks (single or double).

Learning is a mess
  • 7,479
  • 7
  • 35
  • 71