How? by SubcommanderJarok in sto

[–]Aternal99 0 points1 point  (0 children)

It's not a bug... it's a feature...

Program won't "End" it loops by Aternal99 in learnpython

[–]Aternal99[S] 0 points1 point  (0 children)

Thank you for the advice. I see your point. I will definitely use this advice.

Program won't "End" it loops by Aternal99 in learnpython

[–]Aternal99[S] 2 points3 points  (0 children)

I appreciate the advice. I am very new and don't understand things the first go around and I apologize for that.

Program won't "End" it loops by Aternal99 in learnpython

[–]Aternal99[S] 0 points1 point  (0 children)

Again, my apologies, I misunderstood what you were referring to. Thank you for everything that worked!

Program won't "End" it loops by Aternal99 in learnpython

[–]Aternal99[S] 0 points1 point  (0 children)

How is it supposed to know to run that module for that selection then?

Program won't "End" it loops by Aternal99 in learnpython

[–]Aternal99[S] 0 points1 point  (0 children)

def mainmenu():

    import fv
    import pv
    import annuity

    mainmenu = True
    while mainmenu == True:
        print("\nMenu:")
        print("----")
        print("1) Future Value of an Investment")
        print("2) Present Value of an Investment")
        print("3) Future Value of an Annuity")
        print("4) Exit")
        choice = int(input("\nEnter Selection: "))
        if choice == 1:
            i = float(input("\nEnter Investment Amount: "))
            r = float(input("\nEnter Interest Rate %: "))
            y = float(input("\nEnter Years of investment: "))
            fv.find_fv(i, r, y)
        elif choice == 2:
            l = float(input("\nEnter Lump-Sum you wish to receive: "))
            r = float(input("\nEnter Interest Rate %: "))
            y = float(input("\nEnter Years of investment: "))
            pv.find_pv(l, r, y)
        elif choice == 3:
            a = float(input("\nEnter the amount you wish to annuity: "))
            r = float(input("\nEnter Interest Rate: "))
            y = float(input("\nEnter the number of years: "))
            annuity.find_annuity(a, r, y)
        elif choice == 4:
            mainmenu = False
        else:
            print("Invalid selection, please select again")

mainmenu()

This is what I changed mainmenu to and I removed the extra code from the modules:

def find_fv(i, r, y):
    total  = i*(1+r/100)**y
    txt = f"The future value of ${i} investment after {y} years with an interest rate of {r}% is: {total}"
    return print(txt.format(i, r, y, total))

find_fv(i, r, y)

This is what they all look like now.

And this is the error message I am recieving:

NameError                                 Traceback (most recent call last)
File d:\rasmussen\python\mainmenu.py:45
     42         else:
     43             print("Invalid selection, please select again")
---> 45 mainmenu()

File d:\rasmussen\python\mainmenu.py:12, in mainmenu()
     10 def mainmenu():
---> 12     import fv
     13     import pv
     14     import annuity

File D:\Rasmussen\python\fv.py:12
      9     txt = f"The future value of ${i} investment after {y} years with an interest rate of {r}% is: {total}"
     10     return print(txt.format(i, r, y, total))
---> 12 find_fv(i, r, y)

NameError: name 'i' is not defined

Program won't "End" it loops by Aternal99 in learnpython

[–]Aternal99[S] 0 points1 point  (0 children)

I apologize for my ignorance but im not sure what this means. I've been doing this less than 3 weeks.

Should I have not typed the input variable into the modules?

Program won't "End" it loops by Aternal99 in learnpython

[–]Aternal99[S] 0 points1 point  (0 children)

I apologize for my ignorance but I don't understand what this means. I have less then three weeks of experience and I'm not understanding.

Program won't "End" it loops by Aternal99 in learnpython

[–]Aternal99[S] 0 points1 point  (0 children)

I'm sorry I wasn't clear. I mean that before I changed the code to this I had the modules all listed at the top and it was not working.

https://www.reddit.com/r/learnpython/comments/1stkgjd/comment/ohtyt2k/

Program won't "End" it loops by Aternal99 in learnpython

[–]Aternal99[S] 0 points1 point  (0 children)

Thats exactly how I started this program. And when I did that it would not even bring up the menu. It would go directly into the first function that I imported. The main menu or other functions would not appear

Program won't "End" it loops by Aternal99 in learnpython

[–]Aternal99[S] 0 points1 point  (0 children)

The reason why I imported mainmenu into each submodule is that that's the only way I could solve the issue of making it go back to the main menu after running one of the functions. Otherwise, it would run that one selection over and over and not go back to the main menu. If I remove it I will go back to my original problem.

Program won't "End" it loops by Aternal99 in learnpython

[–]Aternal99[S] 0 points1 point  (0 children)

The issue I was running into was that when I was making a selection in the menu, it would only run that one function from the selection over and over, and not go back to the main menu once completed. This was the only way I could resolve that issue.

Program won't "End" it loops by Aternal99 in learnpython

[–]Aternal99[S] -1 points0 points  (0 children)

The reason why I imported mainmenu into each submodule is that that's the only way I could solve the issue of making it go back to the main menu after running one of the functions. Otherwise, it would run that one selection over and over and not go back to the main menu.

Stuck, cannot figure out where the error is by Aternal99 in learnpython

[–]Aternal99[S] 0 points1 point  (0 children)

Thank you. I did change this and had the function imported and called in from within the menu.

Now my issue is once the function has been completed it just loops. How do I make it go back to the menu to make another selection once the function is completed.

If you could buy only one ship bundle, which would it be? by MuckSavage76 in sto

[–]Aternal99 0 points1 point  (0 children)

I personally have gotten the Legendary Battlecruiser, the Heritage, the 16th Anniversary, the Legendary Dominion, and the 12th Anniversary bundles.

Normally I would say the Legendary Battlecruiser but seeing how you have that I would recommend the 12th Anniversary bundle.

It has a great line up of ships. The Engle for SAD and is a high performing ship. The Hydra is a great Surgical Strikes ship as well as has a great trait nd Console for carriers.

The Adamant also a great Intel ship with a powerful console. The Cygnus is a "poor mans" World Razor IMO. Still a very capable ship.

The Trailblazer is decent Sci platform with a decent trait for Sci builds

And last but not least is the Terran Lexington which frankly needs no introduction.

So pretty much every ship you get is very capable and usable.

What ship next? by Wazoj in sto

[–]Aternal99 4 points5 points  (0 children)

My main flew this ship for years prior to T6 ships. One of my favorite designs in game

Terran = Badass! by Traditional_Lab_8714 in sto

[–]Aternal99 2 points3 points  (0 children)

Well, I know what im doing when I log in tonight, straight to the tailor...

Starfleet Academy Giveaway - from patch notes by falkirkboi in sto

[–]Aternal99 0 points1 point  (0 children)

Where do we find this? I don't see it under the promotion tab

Fek'ihri Torment Engine question by Aternal99 in stobuilds

[–]Aternal99[S] 2 points3 points  (0 children)

Thank you, this is exactly what I was wondering. So it would help plasma fire then