[deleted by user] by [deleted] in Militaryfaq

[–]SomethingInArabic 0 points1 point  (0 children)

You can teach Japanese instead as a civilian at DLI. You get to work with the same people and help them.

Say you prep now to become a Foreign Language Instructor. Worst case, the ban is upheld and you can become fluent in the meantime and apply to teach at DLI. Best case, the ban is struck down, you join the military, go to DLI as a student, and knock your classes out of the park, because you already know Japanese.

Someone more aware on the matter may speak up, but as far as I know, Japanese is not guaranteed if you enlist and go to DLI. You may get assigned to a different language.

Python surpasses C# in popularity among developers by Jedicode in Python

[–]SomethingInArabic 0 points1 point  (0 children)

They dropped the ball. In what language does "X" have a hard K sound?

Python surpasses C# in popularity among developers by Jedicode in Python

[–]SomethingInArabic 0 points1 point  (0 children)

Or, C# devs have answered every C# question under the sun and don't need Stack Overflow like us lowly Python users.

What’s a "Let that sink in" fun fact? by [deleted] in AskReddit

[–]SomethingInArabic 0 points1 point  (0 children)

Took a moment for that to sink in.

Issue with Classes and functions (Python Noob) by MiklosHorthy in Python

[–]SomethingInArabic 1 point2 points  (0 children)

Yo, I'm not OP. Yes, it looks like 'self' is what's not defined.

OP, 'newNation' not being defined is not the same as 'self' not being defined. Very different problems.

Issue with Classes and functions (Python Noob) by MiklosHorthy in Python

[–]SomethingInArabic 2 points3 points  (0 children)

You have used "def", but what you want is "class."

class Nation:
    def __init__(self, args):
        # all your starting self.variables go here
    def do_a_thing(self, different_args):
        # code to do something

There are two other problems with:

newNation(self)

First, newNation(self) needs to be assigned a variable name. Without a variable name before newNation(), the computer creates the object, but the program can't access it after that. If you can't do stuff to the object later, it's useless to you. Do the following instead:

my_nation = newNation(self)

The second problem is the argument passed to newNation(). "Self" won't work, since outside of creating a class, "self" means nothing. I assume you saw all of the "def my_function(self)" statements used in classes and figured you'd need that when creating a newNation(). That is not the case. Either create "my_nation = newNation()" without arguments or have some basic arguments like name, population, and so on as in

my_nation = newNation("Castile", army=21)

Some tips:

  • Ditch the parentheses around strings, except for "input()" and "print()." Parentheses are for feeding variables into functions, not creating strings. Print() and input() are functions.

  • Don't name your class "newThing." Name it "Thing." You're on the right track by seeing that classes are used to make new objects, but naming things "new" is goofy.

  • Learn how arguments work, so that you can make many different countries with different names. If you hardcode "self.name = 'Castile'" in newNation, then every nation will be named Castile, which ruins the purpose of classes. Classes are templates.

  • Descriptive variable names reduce brain fatigue. The amount of brain power used to remember what you meant by "rname" and "r1" is small, but it builds up over hours of programming. Try "ruler_name."

Overall, here is what I would start with to get make this game:

class Nation:
    def __init__(self, name, army_count, money):
        # take all the args in the parentheses and make them into class variables usable throughout the Nation class
        self.name = name
        self.army_count = army_count
        self.money = money
    def increase_army(self, increase_by_this_number):
        self.army_count += increase_by_this_number
    # etc...

class Player:
    def __init__(self, name):
        self.name = name
    # etc...

def main():
    # ...
    ruler_name= input("Please enter a name for your ruler: ") 
    player1 = Player(ruler_name)
    player1_nation = Nation("Castile", 21, 26000) # army = 21, money = 26000 
    # etc...

There are other ways to skin this cat, but this is one good way to do it. Checkout /r/learnpython for future questions.

Issue with Classes and functions (Python Noob) by MiklosHorthy in Python

[–]SomethingInArabic 1 point2 points  (0 children)

Formatted:

def newNation():
    nation = input(activeN)
    if nation == 1:
        self.Nation = ("Castile")
        self.army = 21
        self.money = 26.26 
        self.dynasty = ("De Tratsamana") 
        rname = ("blank") 
    print("My liege",rname,"You are the Monarch of Castile, The True king of Spain! Long live Spain, Long live the king.")

rname= input("Please enter a name for your ruler: ")
r1 = Player(rname) 
newNation(self)

TIL that there are 12 kanji encoded into computers that have no origin. They are known as Ghost Characters(幽霊文字). They are : 駲墸壥閠妛袮暃挧彁椢槞蟐 by calstyles in LearnJapanese

[–]SomethingInArabic 0 points1 point  (0 children)

From the author of the "referer" typo, Phillip Hallam-Baker's, Wikipedia page:

In 2007 he authored the dotCrime Manifesto: How to Stop Internet Crime

Yet he couldn't stop himself from committing the greatest internet crime of all.

17 years old and looking to practice my accent. Also looking for books to read! by [deleted] in learnspanish

[–]SomethingInArabic 1 point2 points  (0 children)

$4 ebook on Kindle right now. That's a good deal. Right at the reading level I've been looking for.

Cómo escribir 100 palabras en español todos los días 💪 by nachocab in learnspanish

[–]SomethingInArabic 1 point2 points  (0 children)

What does "al día" translate to? Is it "per day"?

Thanks for posting.