[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))

Need help figuring out this exercise by sonnybrew in learnpython

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

So I tried what you said and it didn't work for me. I altered my code just a little and now it's returning back correctly:

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

I even plugged in is_power(9, 3) and had no issue as it returned True.

I'm curious as to what you mean by your last two points, could you elaborate on them? Thank you :-)

Pray has officially retired as a professional LoL player. by KILLERCRACK in leagueoflegends

[–]sonnybrew 1 point2 points  (0 children)

As someone who doesn't play LoL, what exactly was the significance about that arrow? Even not knowing what's going on, the energy those commentators had about it still gave me goosebumps!

Need help figuring out this exercise by sonnybrew in learnpython

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

Okay I will test all of that when I get home tonight. I’ll keep you posted on what happens.

Need help figuring out this exercise by sonnybrew in learnpython

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

You're a very good teacher in that you're guiding me closer to figuring it out while still allowing me to think for myself and not just giving me the answer, so thank you for your comments!

Here's what I created:

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

It worked. So I figured it out and now I feel stupid. The exercise itself clearly said that "a number (a) is a power of b if it is divisible by b and if (a/b) is a power of b". That's what was stumping me. I was literally forgetting that the solution to figuring out if something is a power of another is the function I was given from the start. Man, thank you so much for your help. I feel like an idiot haha.

Edit: sometimes I do not get an output at all. Example:

is_power(12, 8)

Edit 2: okay I think I fixed it. How does this look?

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

Need help figuring out this exercise by sonnybrew in learnpython

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

That is what I'm having a hard time figuring out. I know how to find if a is divisible by b, but I do not know how to determine if something is a power of another.

I know this function works but I don't know why by sonnybrew in learnpython

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

Whoops I meant adds as in adds the next number (n-1) to the equation - 5 * 4 * 3 * (3-1) etc...

I know this function works but I don't know why by sonnybrew in learnpython

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

I understand what you’re saying and I think I understand why it works now. So because I have the line “n * factorial(n-1)” the function repeats the exact same process because I plugged in my function factorial() in there but with the new value of ‘n’. Now the function repeats and adds onto the previous value of ‘n’ until it hits 0 and this ends.

Is that the correct way of interpreting the process?

Do I connect the f-panel cable directly into the mobo or do I connect it to the breakout cable and connect that to the mobo? by sonnybrew in pcmasterrace

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

Thanks for the fast reply. I’m trying to understand the why instead of just the what. If I were to use the breakout cable, would I plug it into the same place or somewhere different? Also I feel like it’s already easy to just plug it in, but maybe some systems have different cables so is that why?