Basic program to convert integer to Roman numerals?

后端 未结 24 1303
孤独总比滥情好
孤独总比滥情好 2020-11-30 11:52

I\'m trying to write a code that converts a user-inputted integer into its Roman numeral equivalent. What I have so far is:

The point of the generate_

24条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-30 12:38

    When you use the def keyword, you just define a function, but you don't run it.

    what you're looking for is something more like this:

    def generate_all_numerals(n): 
    ...
    
    def to_roman(n):
    ...
    
    print "This program ..."
    n = raw_input("Enter...")
    
    print to_roman(n)
    

    welcome to python :)

提交回复
热议问题