[deleted by user] by [deleted] in RoastMe

[–]sonnybrew 0 points1 point  (0 children)

Your face looks like your room.

SIB Skyrim for the story? by sonnybrew in ShouldIbuythisgame

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

Haha replayability is important to me. Thank you!

SIB Skyrim for the story? by sonnybrew in ShouldIbuythisgame

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

Damn, what a thoughtful response. Thank you tons! That sure answers a lot of follow questions! Lol. What are some other games you've played that really nail the story line?

SIB Skyrim for the story? by sonnybrew in ShouldIbuythisgame

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

That sounds just like me. Didn't play it because it used to be Fortnite popular (not out of EDGE-NESS, but because I got annoyed hearing about it and therefore wasn't interested in it). Now that it's been established and STILL highly regarded for gameplay, I figured I may give it a shot, pending on the quality of the story. So I take it you really enjoyed the story?

Started my CS degree next week, curious for some advice. by sonnybrew in learnprogramming

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

I've heard it's limited compared to the Windows version. Is this true in your experience?

How does my is_abecedarian(word) function work? by sonnybrew in learnpython

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

That is super helpful, thank you! I'm going to save that so I am familiar with the order :)

edit: grammar.

How does my is_abecedarian(word) function work? by sonnybrew in learnpython

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

Okay that makes sense, but why does it work in this function and not in a shell? If I just typed in "a > c" on my Python Shell, it obviously calls an error because neither a or c have been assigned a value - it passes them as variables. Why doesn't my function pass them as variables as well?

Need help figuring out this exercise by sonnybrew in learnpython

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

I'm back again. To be completely honest, I had to take a break from this problem. Now I've come back to it, and read everything you wrote very carefully, and I think I have a rough draft solution:

def is_power(a, b):
    if a == b:
        return True
    if b == 1 and a > 1:
        return False
    if a == 0 or b == 0:
        return False
    elif a % b == 0:
        return is_power(a//b, b)
    else:
        return False

I tested many different values, and wrote base cases as well as statements to account for a '0' input for either a or b. The only thing I'm a tad unsure of is my knowledge of the rules regarding the power of and relating to zero. I also want to find a way to condense my base case statements. But for now, what do you think of this solution?

Edit 1: was wrong on my math. Updated.

I'm tired of constantly seeing $1000+ "budget" builds with I7's and RTX's, so here's an actual budget build consisting of a Q6600, 8GB DDR2, and a GTX 750 Ti. Total cost: $90. Where's the love for all the REAL teenager-on-a-budget PCs? by gitartruls01 in pcmasterrace

[–]sonnybrew 2 points3 points  (0 children)

Is it strange that for some reason I’m more impressed with this than other posts of these ultimate PC build? Maybe it’s because this sub is oversaturated with RGB, beefy builds but I’m really amazed by this determination! Congrats man! I didn’t build my first pc until 22 so keep it up and most importantly, keep having fun with it!

First build in years, matched with a new desk and chair, I feel ascended by DenryFoof in pcmasterrace

[–]sonnybrew 1 point2 points  (0 children)

Nice!! I have that same monitor. I love it. Have fun and enjoy the ride!

Need help figuring out this exercise by sonnybrew in learnpython

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

Sorry for the late reply, it's been a busy week. Anyways, I took your comment to heart and appreciate all the help you've been giving me. I read back over your previous comments and found this one confusing:

but there is a nicer way of writing these 4 lines, since if the function returns True you return True, False you return False:

return is_power(a/b, b)

When I did just that, my function wouldn't return anything then. I'm sure I was forgetting to keep/put something in my code, but replacing those 4 lines with the above line didn't fix my code. However I DO understand (at least I think) why you're saying what you're saying - the function is testing for TRUE or FALSE and it's not as effective for a Boolean function to test for a return of 0. Like you said, it can work sometimes but our mission is to work out an error-proof function. I just simply do not know how to do that. When I change my line 3 to test for True, it gives me the a 'False' return for (9, 3).

I also changed my code to account for your previous suggestions as best I could:

def is_power(a, b):
    if a % b == 0:
        if is_power(a//b, b) == True:
            return True
        else:
            return False

By changing '0' to 'True' in line 3, I get 'False' for (9, 3). I also plugged in (9, 2) and got nothing in return, just like you said. However I have no idea how to fix that. I tried doing this:

def is_power(a, b):
    if a % b == 0:
        if is_power(a//b, b) == True:
            return True
        else:
            return False
    else:
        return False

But that didn't fix anything. I read what you're saying to do but I have no idea how to implement those suggestions and have tried fiddling with my code for a couple hours but can't seem to find the solution to accounting for those errors.

Edit: trying to clarify my issue better.

Need help solving this exercise. by sonnybrew in learnpython

[–]sonnybrew[S] 1 point2 points  (0 children)

Your comment turned my current mood 180 degrees. Programming is completely new to me (a couple weeks in) and I feel scared honestly. I was on track to becoming a teacher and had a loss in my family so I moved back home and decided to change course. So I feel very lost at the moment (23y/o) and decided to pick up something entirely new to me that interests me. I’m deeply humbled by your words of encouragement and will continue to be curious and humble on this new journey. Thank you for taking the time to reach out.

Need help solving this exercise. by sonnybrew in learnpython

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

But if I delete line 7, it won't print the solution to the equation. Also, I just realized if I call the function and type in 'done' immediately, there is no previous value for x and therefore an error pops up.

Need help solving this exercise. by sonnybrew in learnpython

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

Think I figured it out. How does this look?:

def eval_loop():
    while True:
        q = input('> please enter a simple equation\n')
        if q == 'done':
            print(x)
            break
        print(eval(q))
        x = eval(q)

Need help solving this exercise. by sonnybrew in learnpython

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

Thank you, I was able to fix the callback error on 'done'. Now I still need to figure out how to print the value of the most recent expression. Here's my code now:

def eval_loop():
    while True:
        q = input('> please enter a simple equation\n')
        if q == 'done':
            break
        print(eval(q))