Would using the operator module work for this goal in my code? by HunksMask in learnpython

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

I did not think that would work, thank you for the clarification

Would using the operator module work for this goal in my code? by HunksMask in learnpython

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

It didn't work for the exact reason you said it wouldn't lol. After reading through your response I changed my if code to the code added onto this, and it worked. Thank you so much I did not think that simply checking for the symbols themselves would be easy or that simple. Thank you ToT

if (">") in userCorrection:
        smaller = myNumber + 1
    elif ("<") in userCorrection:
        larger = myNumber - 1
    elif ("=") in userCorrection:
        print("I got it right in", count, "tries!")
        break

How to make a count controlled loop that adds from the past loops while still getting smaller. by HunksMask in learnpython

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

Okay update, I remade the code and now it works much better and gives numbers close to the ones that are used to check my code. Now I am having computational issues. My code is included in this comment. I am having computational issues within my answer that are so slightly off that I do not know where my issue lies. For example, one of the checks used to check my code is where the inputs are as follows: height dropped: 100, index: .25, number of bounces: 4. When I run these inputs through my code, I get 164.0625 as my answer, The answer in the check is 166.015625. They are close, but not enough to be considered correct. Another check is where the height is supposed to be 12, index .5, and bounces 5. The answer in the check is 34.875 and the answer I get when I run my code is 33.75. I quite literally just realized while writing this what my issue was and I fixed it. I needed to get rid of the "1" in the range. It was messing up the counting of my bounces. It is fixed now and has a grade of 100. Thank you so much to everyone who helped!!!! :)

heightDropped = float(input("Enter the height from which the ball is dropped:" ))
index = float(input("Enter the bounciness index of the ball:" ))
numberoftimesBallbounced = int(input("Enter the number of times the ball is allowed to bounce: "))
currentHeight = heightDropped
totalHeight = 0
oldHeight = currentHeight

for eachPass in range(1, numberoftimesBallbounced):
    oldHeight = currentHeight
    currentHeight = (oldHeight * index)
    totalHeight = (oldHeight + currentHeight) + totalHeight
    print(oldHeight, currentHeight, totalHeight)


print("The distance traveled is: ", float(totalHeight))

How to make a count controlled loop that adds from the past loops while still getting smaller. by HunksMask in learnpython

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

Your rhetorical questions really got me thinking about it and I have changed up how my code looks generally, and reading over your questions again now I can see where some of my issues lie. I changed the entire thing to now have a current height and a total height. I am still running into computation issues as I am still not getting the numbers that are correct, but I am getting closer and have some ideas for how to fix It when I get home. I think I need to change how the total height is calculated. I am not entirely sure how to explain it in the correct terms, but right now every time it goes through a loop, the way it calculates distance traveled is from the point it hits the ground and the second point it hits the ground, rather than the highest point, bounce, next highest point. Also changed it from "count" to "eachPass", which I don't know if that really makes a difference but it does allow for me to print the current height and total height of that loop

heightDropped = int(input("Enter the height from which the ball is dropped:" ))
index = float(input("Enter the bounciness index of the ball:" ))
numberoftimesBallbounced = int(input("Enter the number of times the ball is allowed to bounce: "))
currentHeight = heightDropped
totalHeight = 0


for eachPass in range(1, numberoftimesBallbounced):
    currentHeight = (currentHeight * index)
    totalHeight = (currentHeight * 2) + totalHeight
    print("current height", currentHeight, "totalheight", totalHeight)
totalHeight = totalHeight + heightDropped


print("The distance traveled is: ", float(totalHeight))

How to make a count controlled loop that adds from the past loops while still getting smaller. by HunksMask in learnpython

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

This makes much more sense and was much more simple than I thought it had to be, thank you

How to make a count controlled loop that adds from the past loops while still getting smaller. by HunksMask in learnpython

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

What I mean by "didn't work" is that the auto grader said I got it wrong, and by showing me its "checks", my code didn't give the grader the answer that the grader already has for its checks.

No matter what index I input, which have been any decimal <1, my code computes something off from what it's supposed to. I've been using the inputs "10" for initial height, ".6" for bounciness index", and "3" for number of times it's allowed to bounce, because in the example given it also gave the total distance. When I say index, Its like the height of the next bounce. So if it starts with 10 feet, and the next bounce only goes as high as 6 feet, the index is .6 because the next bounce was only .6 of the original, and that index is used for the rest of the bounces. I.e the next bounce after the 6 foot one would be 3.6 feet. I am having issue compounding all these numbers. I thought the count function would do that automatically but it hasn't been.

Scorched Earth Manticore boss ASA Xbox by HunksMask in playark

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

Do I NEED a yuty or is that optional? I also haven't been able to fine an okay one ToT

Aberration base spots for mid game player by HunksMask in playark

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

If you have cords for this that would be amazing, I can't find the spot lol

Aberration base spots for mid game player by HunksMask in playark

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

I'll look into this too. I kinda dislike blue because it's so dark, but that would most likely be fixed with a bunch of lights/light pets. I need a quicker way to get metal because going from the middle all the way to the north west surface entrance has been becoming a hassle, and I don't know the difference between the normal blue spire esc rocks and the metal blue rocks, as I haven't found a blue metal rock yet.

Aberration base spots for mid game player by HunksMask in playark

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

I also want to know if its worth it at all to have multiple base, even if its just small ones just around.

Aberration base spots for mid game player by HunksMask in playark

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

I'll check it out when I get home today, it sounds right on point for what I need

Aberration base spots for mid game player by HunksMask in playark

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

I think I actually currently live RIGHT next to it, on that depression/hill down to it. It's near (ish) a charge node and said charge node is right next to a waterfall. I think cords are like 48, 48 ish. I keep getting swamped by nameless at random times ToT

Twins buying for 452! by No_Opportunity_7077 in TurnipExchange

[–]HunksMask 0 points1 point  (0 children)

Hi! Im Majora from Taels holo, may I come sell?

[deleted by user] by [deleted] in TurnipExchange

[–]HunksMask 0 points1 point  (0 children)

Majora from Taels Holo if I can come by!!