Last answered:

06 Jan 2023

Posted on:

30 Dec 2022

0

Unnecessary quotes in modulus operator

category = 'A'
num = 10

print("This is from category '%s' and we have '%d' left." %(category, num)) will produce

This is from category 'A' and we have '10' left.



while print("This is from category %s and we have %d left." %(category, num)) produces

This is from category A and we have 10 left.

which is probably what you want.

1 answers ( 0 marked as helpful)
Instructor
Posted on:

06 Jan 2023

0

Hi Marvin!
Thanks for reaching out.

Thanks for sharing this piece of information with the Community!
What is the question? Thank you.

Looking forward to your answer.
Best,
Tsvetelin

Submit an answer