-2

I'm looking for how, in Python, to display the mention of a century after Jesus Christ.

For example :

  • I would display “Ier siècle”
  • VII would display “VIIe siècle”
1
  • these are just notation conventions, they're not programming-related Commented 3 mins ago

1 Answer 1

-1

This can be done using the given function in which we are comparing values and showing the info accordingly.

def displaycentury( century_val ):
    if century_val == 1:
        return f"{century_val}er siècle"
    else:
        return f"{century_val}e siècle"

This can be used like print(displaycentury(1))

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.