Untitled attachment
https://files.techhub.social/media_attachments/files/113/212/582/920/267/886/original/ff14613aacb0a1da.jpg
Convert decimal numbers to Roman numbers with #Python
#!/usr/bin/python3
import sys
x=int(sys.argv[1])
anums = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]
rnums = "M CM D CD C XC L XL X IX V IV I".split()
ret = []
for a,r in zip(anums, rnums):
n,x = divmod(x,a)
ret.append(r*n)
print (''.join(ret))
GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.
All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.