Skip to content

Conversation

collateralusr
Copy link

The value function is used to map Roman numerals to their decimal values, and the romanToDecimal function converts a Roman numeral to an integer using the given mapping.

@vanshdhiwar09
Copy link

nterms = int(input("How many numbers")) n1,n2 = 0,1 count = 0 if nterms <= 0: print("Please enter a positive integer") elif nterms == 1: print("Fibonnaci sequence upto",nterms,":") print("n1") else: print("Fibonnaci sequence.") while count < nterms: print(n1) nth = n1 + n2 n1 = n2 n2 = nth count += 1

@@ -0,0 +1,40 @@

def value(r):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use switch statement, they are far better instead of this.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea

while (i < len(str)):
s1 = value(str[i])
if (i + 1 < len(str)):
s2 = value(str[i + 1])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leetcode problem idea...I see.

Copy link

@dexterharrison29 dexterharrison29 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this code is so fucking awful... Lemme pullup with a better one

Copy link

@dexterharrison29 dexterharrison29 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

@AbhyudayMeher2005 AbhyudayMeher2005 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants