Answer the question
In order to leave comments, you need to log in
Python help a newbie?
Good day to all, I decided to study programming from books, it turns out a little, tell me with a simple question, maybe stupid, but I don’t understand.
I write the script
a=4
b=5
c=9
print("c","-b","=",a)
Why does it give it out later like this
cb=4
I need to get an answer in numbers instead of letters
what and where I'm doing wrong how right
Answer the question
In order to leave comments, you need to log in
a=4
b=5
c=9
print('{2:d}-{1:d}={0:d}'.format(a, b, c))
# выведет: 9-5=4
{2:d}
, this is the place to display the value. 2 is the position of the argument, the third will go here, c
. d
means number.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question