# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     name: python3
# ---

# + [markdown] id="view-in-github" colab_type="text"
# <a href="https://colab.research.google.com/github/apavanreddy48/GFPGAN/blob/master/Conversion%20of%20numerical%20into%20roman%20using%20if%20and%20%20while%20loof.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>

# + colab={"base_uri": "https://localhost:8080/"} id="Crcn7VCNbMSl" outputId="aeb404f3-c93f-4d03-a984-d67a0e251cc3"
n=int (input("Enter the value:"))
if (n<=0):
  print("Entered number is not valid")
else:
  while (n>=1000):
    print("M",end="")
    n=n-1000
  if (n>=900):
    print("CM",end="")
    n=n-900
  if (n>=500):
    print("D")
    n=n-500
  if (n>=400):
    print("CD",end="")
    n=n-400
  while (n>=100):
    print("C",end="")
    n=n-100
  if (n>=90):
    print("XC",end="")
    n=n-90
  if (n>=50):
    print("L",end="")
    n=n-50
  if (n>=40):
    print("XL",end="")
  while (n>=10):
    print("X",end="")
    n=n-10
  if (n>=9):
    print("IX",end="")
    n=n-9
  if (n>=5):
    print("V",end="")
    n=n-5
  if (n>=4):
    print("IV",end="")
    n=n-4
  while (n>=1):
    print("I",end="")
    n=n-1
  







  

StarcoderdataJupyterScriptsDedupFiltered