As mentioned in the title, how do I get Python to print out +1 instead of 1?
score = +1
print score
>> 1
I know -1 prints as -1 but how can I get positive values to print with + sign without adding it in manually myself.
Thank you.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
With the
%operator:With
str.format:You can see the documentation for the formatting mini-language here.