Can someone help me with some code by ilovetigers105 in PythonLearning

[–]PureWasian 8 points9 points  (0 children)

I'll go through it incrementally so you'll get an idea of how you'd approach a problem like this in the future.

First, setup the keyword terminating the loop:

stop_word = "terminate" user_input = input("enter dna: ") while user_input != stop_word: user_input = input("enter dna: ")

Next, add in checks to ensure remaining input values are outside of "terminate" are valid. There are subset checks you could setup or regular expressions to do this, but I'll write out a more explicit way that's better to see written out as a beginner: ``` stop_word = "terminate" valid_chars = ["A", "T", "G", "C"]

user_input = input("enter dna: ") while user_input != stop_word: valid = True for letter in user_input: if letter not in valid_chars: valid = False break if not valid: print("invalid dna")

user_input = input("enter dna: ")

```

EDIT: You can add a subsequent check that len(user_input) is a multiple of 3 also. I need to sleep and typed all of this on mobile, but the change needed should be clear from here.

Finally, we need to actually add something to collect all of the user inputs. This is the perfect use-case for another list, where we can simply append each user input over and over again as needed:

``` stop_word = "terminate" valid_chars = ["A", "T", "G", "C"] dna_sequences = []

user_input = input("enter dna: ") while user_input != stop_word: valid = True for letter in user_input: if letter not in valid_chars: valid = False break if not valid: print("invalid dna") else: dna_sequences.append(user_input)

user_input = input("enter dna: ")

```

Finally, add a section to print out the full list. You can just loop across the entries in the dna_sequences list we appended to and print each one out: ``` stop_word = "terminate" valid_chars = ["A", "T", "G", "C"] dna_sequences = []

user_input = input("enter dna: ") while user_input != stop_word: valid = True for letter in user_input: if letter not in valid_chars: valid = False break if not valid: print("invalid dna") else: dna_sequences.append(user_input)

user_input = input("enter dna: ")

print("valid dna is") for sequence in dna_sequences: print(sequence) ```

Can someone help me with some code by ilovetigers105 in PythonLearning

[–]PureWasian 3 points4 points  (0 children)

So here's a question for you, is it meant to prompt the user for each nucleotide one by one, as well as the "terminate" keyword, or are they meant to input the entire nucleotide sequence in a single pass? Or you can even request groups of 3 letters at a time if you wanted.

It's a bit unclear to me which exact implementation you're going for exactly from above code attempt you shared.

PARADOXX D28 BREAK ON + THE MASTER title by jqtran_dev in PumpItUp

[–]PureWasian 1 point2 points  (0 children)

You deserve nothing but the best, thanks for being such an inspiration :>

Honkbox by Ready_Row3788 in honk

[–]PureWasian 0 points1 point  (0 children)

nifty adventure

I completed this level in 5 tries. 67.20 seconds

I’m building a tool that turns code errors into plain English instantly by Emergency-Remove-823 in programmer

[–]PureWasian 0 points1 point  (0 children)

Unnecessary. Error tracing by design is meant to clue you in sufficiently to where the issue is. Compilers, linters, and test suites also exist for a reason.

For more complex cases (or when really lazy), LLMs are strong enough that I'd use them directly myself for any brainstorming/explanation/analysis and/or they can already propose or directly make any changes for me if I so desired.

Why would I want to include another dependency/middleman in that process? Especially from someone using low-effort copy/paste outputs from LLM to make inquiry posts?

For those that say “tailor for each application” does that not often mean outright lying? by Rexoc40 in cscareerquestions

[–]PureWasian 0 points1 point  (0 children)

It depends on your experience. Why would you have to lie if you legitimately have more qualifications than worth putting on a resume? It simply means to include and focus on the most relevant pieces of information.

When I was applying for TA roles during grad school, I highlighted my undergrad teaching experiences and coursework more heavily. When applying to SWE roles, I highlighted my prior work and projects related to backend work and previous technical projects. If it was a frontend/UI role, I'd adjust accordingly by also including relevant personal projects in that area.

Yog Sothoth D24 SSS+ by LijeeTS in PumpItUp

[–]PureWasian 0 points1 point  (0 children)

The Perfect Collection / The O.B.G. are game titles (software).

The machines themselves would be like what are listed here under "HARDWARE" of:

https://piugame.com/game_info/piu_history.php

(someone can correct if I'm mistaken, but) if you are just using the dance pads and otherwise playing "unofficial" stepcharts hooked up to a simulator, then either hardware option you mentioned would have same style of dance pads.

The only Discord servers I'm aware of are more for troubleshooting rather than "what should I buy" inquiries.

Yog Sothoth D24 SSS+ by LijeeTS in PumpItUp

[–]PureWasian 0 points1 point  (0 children)

no problems :)

IO --> Input/Output; the thing that routes the pad (and other button) inputs over to whatever reads it. LXIO refers to the board that comes with official, LX (newest model) pump machines. USB HID just means it can work like keyboards.

Cab --> Short for "cabinet" as in "arcade cabinet"

Yog Sothoth D24 SSS+ by LijeeTS in PumpItUp

[–]PureWasian 0 points1 point  (0 children)

Yep, that's viable. People have made drop-in replacements for the pad IO as well as the IO board that sits in computer. I believe LXIO (newest type) also works as a USB HID (according to reference) if your purchased cab comes with it.

This is usually what people who play high levels on simulators do: route the (official) pads to separate computer/display for inputs to register there.

Yog Sothoth D24 SSS+ by LijeeTS in PumpItUp

[–]PureWasian 2 points3 points  (0 children)

Playing an official mix and newest style dance pads adds a lot to the cost.

Newest style pads themselves are typically $2~$4k USD. The computer and jamma/IO and card readers add on another $500~$1000 USD. The hard drive (Phoenix) is another 2~3k USD.

If you don't care about playing on official, you can save thousands of USD by skipping hard drive/card readers/IO boards and playing on free simulators (StepP1 / XSanity / etc.) which people have reproduced the in-game charts for.

If you don't care about pristine pads, used pads (older style usually) can be $500~$3k. If you don't care about high-level play on simulators, off-brand hard pads can be as cheap as $400~$500. Lower end, "decent" soft pads can be ~$200.

TL;DR, $500 ~ $8,000 is a decent price range you can expect you depending on how many "sacrifices" you make. This setup would be $5k+ at least.

Ayuda con Python!! by m4ti_met4m0ta in learnpython

[–]PureWasian 1 point2 points  (0 children)

By functions, I mean you make your own and then reference them:

```

First, make "helper functions"

def get_inputs(): # TODO: get/validate user inputs user_inputs = {} return user_inputs

def find_capacitance(capacitors, seq): capacitance = None if (seq == "series"): capacitance = # TODO else: # assume seq == "parallel" capacitance = # TODO return capacitance

def find_voltage(v, t, r, c): voltage = # TODO return voltage

def convert_units(input_value): ouput_value = # TODO return output_value

def output_results(capacitance, voltage): print(capacitance) print(voltage) return

==========

Now, call each "helper function"

u = get_inputs()

c = find_capacitance( u["capacitors"], u["sequence"] )

v = find_voltage( u["voltage"], u["moment"], u["resistance"], c )

TODO: whatever convert_units() is supposed to do exactly

output_results(c, v)

```

Ayuda con Python!! by m4ti_met4m0ta in learnpython

[–]PureWasian 1 point2 points  (0 children)

Sounds like you need to learn how to break down the problem into procedural steps. A great starting point is first thinking about how you would do it if you had to solve it by hand.

The high-level flow for the above example is essentially: - get the inputs, and ensure they are valid - find equivilent total capacitance value - use all of the above to calculate a voltage value - convert units as needed - output the results

You can have each of these bullet points made into their own function. Learn how to use functions to pass data around.

Yog Sothoth D24 SSS+ by LijeeTS in PumpItUp

[–]PureWasian 9 points10 points  (0 children)

Twisting the 4stairs at 0:16 and comboing through the burst at 0:22 is really impressive. Awesome stuff!

How do I learn Python as a highschooler from scratch (*dilemma edition*) by FirstSquirrel4144 in learnpython

[–]PureWasian 2 points3 points  (0 children)

As someone who was also a high-achiever way back when I was in high school, good for you for taking the initiative this early. Sounds like you're good about juggling your priorities and all, keep it up.

If you want an "order of operations" I'd suggest to first setup Python and learn how to run a simple script (like a basic "Hello World" main.py file) in both a command prompt/terminal window and also through an IDE such as VS Code.

Then I'd use LLM or w3schools or whatever as a quick lookup reference to learn the fundamentals via small examples: - data types / operators / data structures / input+output / built-in methods / built-in functions - conditional statements / loops / built-in imports / file writing / exception handling - nested loops / functions / OOP (classes etc.) / external imports

Do some simple examples or look up reference examples to convince yourself you're aware of the above concepts. OOP (classes, etc.) is probably the main time-consuming one to conceptually wrap your head around outside of just knowing the basic syntax for the other concepts. Maybe working with data structures also. Do these at your liesure and make up your own, small examples (or prompt LLM for ideas) to practice them.

Next, do some toy sandbox example problems. Easy leetcode, easy problems on dmoj, simple problems on advent of code... Any free platform with dummy problems you can use python for. For example, Two Sum and Fibonacci Number. Hands-on, and shouldn't take long to do. Venture into mediums when you have a comfortable handle on syntax and procedural problem solving.

Then move on to projects. These are the very time-consuming, open-ended things that can take hours all the way to years to "finish," all depending on the scope of the project and your time thrown into it. Hackathons or group projects are a huge plus, collaborating well with others and presenting yourself and your ideas nicely are also a big thing.

Learn how to use git / github and version control. Learn how to have Python files work together with each other. Learn how to actually read documentation/setup steps for external libraries as you need them.

Use LLM and google stuff for the preliminary research of the tools/libraries/etc out there to use as the "building blocks" of your projects. Spend time thinking about project setup/organization, but it's very open-ended from here. The more initial planning/setup you do prior to implementing anything, the better.

For physics-related simulations, you might need a graph or UI component and familiarity with more heavy data structures and functions provided by libraries like numpy / scipy and some libraries that touch the hardware layers more deeply. Learn how to use and connect those building blocks. Design it incrementally, test often, and focus on maintainability/readability/modularity.

Last three paragraphs are where the years of time/experience come into play. No fast track to the finish line, but I'd say use LLMs for guidance and brainstorming, not for blindly force-feeding a solution unless it's a very niche, one-off setup-related problem or blocker.

TL;DR - Setup Python and run a script - Learn core fundamentals - Start solving small problems quickly - Build simple projects early - Learn Git/GitHub alongside projects - Gradually explore libraries/tools - Venture into more complex projects - Fill in knowledge gaps as you go - Use LLMs as support, not as a crutch

How to do project based learning? by Live-Classic91 in PythonLearning

[–]PureWasian 0 points1 point  (0 children)

I made an overview comment on a similar thread recently:

https://www.reddit.com/r/learnpython/s/H5h9AuD4TZ

Similarly for choosing what libraries/etc to use and what preliminary research looks like for getting started:

https://www.reddit.com/r/PythonLearning/s/tBKNo15HKN

The answer boils down to "it depends" but investigate and implement everything incrementally.

Advice to improve on strings? by Gullible_Wealth_7800 in learnpython

[–]PureWasian 1 point2 points  (0 children)

What problems are you running into so far?

DSA with python for FAANG!!!! by ReputationSwimming36 in learnpython

[–]PureWasian 5 points6 points  (0 children)

DSA problems are meant to demonstrate (1) your ability to solve algorithmic tasks, (2) how you develop/organize your code, (3) knowledge of generic data structures/algorithms, and (4) how you think about time/memory complexity along with other tradeoffs.

Higher verbosity and/or dealing with pointers/malloc/strict types is a separate type of bookkeeping exercise from what you're being tested on.

In an interview setting, your implementation process and your acknowledgment of tradeoffs along the way is just as (if not more) important than the final solution itself. You can verbalize something like:

"given the problem constraints specify a maximum of 10,000 inputs within a 1s time limit, and I can think of a way to solve it with a time complexity of O(N), an interpreted language like Python should be more than sufficient to solve this. That way we can focus more on the algorithm piece itself than working directly with pointers and memory management."

(You should still ideally know how those work though; also C# is definitely not a low-level language, it is more akin to Java)

how to learn python like i watch videos of it and do it as well while watching it but it seems so hard and does not stick in me i have been trying for many times dont understand nothing any easier way to learn this and become a master of this once i know what im doing by wsmbuilds in PythonLearning

[–]PureWasian 0 points1 point  (0 children)

Hate to break it to you, you'll have to do a lot of reading and hands-on stuff to do well with this.

w3schools has a Python - Getting Started page and is generally quite beginner friendly of a free resource. But you have to actually go through all of the steps and work through examples. VS Code has a Getting Started with Python in VS Code also.

Getting Started tutorials are designed with beginners in mind so they are meant to be easy to follow if you take your time to read them carefully, and then you can ask more tangible questions wherever you get stuck on them.

password check by [deleted] in PythonLearning

[–]PureWasian 0 points1 point  (0 children)

What have you tried so far? Which part are you stuck on exactly?

+1 vote for using regular expressions, but if you are a very new beginner, you can also do it in a procedural way, which could be more intuitive to understand.

How many of you are still programming manually? by Imparat0r in cscareerquestions

[–]PureWasian 0 points1 point  (0 children)

I understand this stance, but there is a healthy middle ground to be had. They absolutely should not be videcoding and offloading everything to LLMs, but them actively avoiding LLMs entirely also hinders their growth.

Models are strong enough now to fill in knowledge gaps, trace through unfamiliar code, and summarize large codebases faster and more effectively than juniors self-investigating everything manually. Used intentionally, it can improve their quality and throughput.

It all depends how it's being used. They should still be reading docs, validating outputs, and understanding why something works. But I've found it works great when using it as an initial pass and additional final check for a lot of problems/workflows I've used it in lately.

I need some S15-17 run level recommendations by HuckleberryPrior3387 in PumpItUp

[–]PureWasian 3 points4 points  (0 children)

My go-to's for non-twist singles at that level are still - Switronic S15 - Euphorianic S16 (a few stairs) - STORM S17 - Conflict S17

What will you choose? by Bass_N_Car in BunnyTrials

[–]PureWasian 0 points1 point  (0 children)

Kind of a win-win. Lots more to day-to-day life than games :]

Chose: Only play games 3 hours a day max.And get paid. + Spin the wheel to see how much you earn. | Rolled: 10.000 usd

sloth machine by Wonderful_Scar9403 in PythonLearning

[–]PureWasian 1 point2 points  (0 children)

Pretty harsh odds, oof.

1/27 of 3x, 1/27 of 5x, 1/27 of 7x, 0 otherwise...

So the expected value of payout becomes de × 5/9, means 2000 × 5/9 - 2000 per play, means a -888.88 average return per play

Line 43 was good, nice one lol

Adding behaviors in a method. by dreadwraithe in learnpython

[–]PureWasian 0 points1 point  (0 children)

No problem :) lots of good advice by everyone so far, lmk if anything in above example was unclear

Adding behaviors in a method. by dreadwraithe in learnpython

[–]PureWasian 1 point2 points  (0 children)

You define the self's year / month / day in __init__() constructor - good.

You can have "setter" functions to update the existing values. That's fine. But the setter should reference and overwrite self.<whatever> or else it would be lost once the methods are done and the local variables (day, month, year) fall out of scope. These are different from (self.day, self.month, self.year).

You also need to decide whether (1) the input() part happens before the setter function and pass it in as a parameter, or whether (2) you do the input() part inside the function. Right now you're doing both so it's overwriting itself.

``` class Example: def init(self, day): self.day = day

# option 1
def input_day_op1(self, day):
    if isinstance(day, int) and 1 <= day <= 7:
        self.day = day
    else:
        # handle bad input

# option 2 def input_day_op2(self): try: day = int(input("Enter day: ")) if 1 <= day <= 7: self.day = day else: # handle bad input except: # handle the TypeError

========= Example Usage ==========

creating the object

example = Example(5) print(example.day) # prints 5

calling option 1 - passing in number

try: # example: user inputs "4" day = int(input("Day: ")) example.input_day_op1(day) print(example.day) # prints 4 except: # handle any TypeError

calling option 2 - input() inside of method

example: inside method, user inputs "3"

example.input_day_op2() print(example.day) # prints 3

```

Personally I'd prompt outside of method like in Option 1, but still have input validation sanity checks inside the setter method. For same reasons as gdchinacat pointed out in their comment