Answer to Question #348089 in Python for ajay

Question #348089

instead of printing 1x - 1 we need x - 1 how ?


1
Expert's answer
2022-06-06T08:57:36-0400
n = 1
a = 1
# in this condition, we check if our x is equal to 1, 
# then a space will be displayed 
# (instead of a space, you can use the None value, but it will be displayed as Nonex - 1
if n == 1:
    n = ''

print(f'{n}x - {a}')

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS