Author Topic: So I wrote my first Python module today :D  (Read 1401 times)

There are other ways of doing that. there are many different arbitrary precision math libraries for C++. Not sure if any of them are as easy to use as pythons is...
yeah thats the reason i choose it over libraries. its easy to use
most libraries out there barely, and i mean just barely have any documentation. most of them are convoluted beyond belief too. no thanks

Wtf, lol. Unsigned longs go up to 4,294,967,295. Unsigned long longs go up to 18,446,744,073,709,551,615. Do you really need to use numbers larger than eighteen and a half quintillion??

#Zero indexed function that returns the character at the specified length.
def char(string, index0, index1):
    if(not len(string)):
        return False
    else:
        return string[int(index0):int(index1)]

#Here we actually do the translation.

def pygLat(string):
    if(len(string) and string.isalpha()):
        return char(string.lower() + string.lower()[0] + "ay", 1, len(string.lower() + string.lower()[0] + "ay"))
    else:
        return False

Also, if any of you have pointers/things to fix/see a problem with this, please let me know.

I'll interpret that as "butcher your code"

def pygLat(string):
    return string.isalpha() and string[1:] + string[0].lower() + "ay"

Realistically it probably doesn't even need to be defined as a function. More than likely the function would only be called from one point anyway, and since it offers no code-cleaning utility being a 1-liner, you could just insert that right into your variable declaration.

whats so bad about it? also what other languages would you recommend learning?

japanese is a really good language to learn if you want to live in a country without baka gaijins

Wtf, lol. Unsigned longs go up to 4,294,967,295. Unsigned long longs go up to 18,446,744,073,709,551,615. Do you really need to use numbers larger than eighteen and a half quintillion??
rsa bruv

C++ is a cool language.
And if you can do C++ you can do C.
And Java if you're fine with objects.

python is not a good language to start with,
use something more modern and intuitive, for example lua
cpp isnt great either as the syntax can be confusing
same with java

isthay isyay ayay eryvay eatnay odulemay. oodgay objay.
oesday ityay anslatetray ackbay otay englishyay?
This is a very neat module. Good job.
Does it translate back to english?

Just started learning Python today.
Pretty loving pumped.

Does it translate back to english?

english = pyglatin[-3] + pyglatin[:-3]
pyglatin = english[1:] + english[0].lower() + "ay"

isthay isyay ayay eryvay eatnay odulemay. oodgay objay.
oesday ityay anslatetray ackbay otay englishyay?
WOWWWWW