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}
1

1 Answer 1

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).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.