Conversation
print("\n"+"response 2")
nathanielpolley
left a comment
There was a problem hiding this comment.
Hi Sara, it's great to see you diving deeper into bioinformatics! Just remember to keep your sense of humor intact; after all, in the world of data, sometimes you have to laugh at your own syntax errors! If you ever feel overwhelmed, just remember that bioinformatics is like finding a needle in a haystack, where every piece of hay looks like a needle. And the needle is cancer..but don't worry, you've got this! After all, you're already fluent in R and Linux. Soon you'll be making the genomes float and leaving everyone else stranded in your wake. Welcome aboard!
Ah, a literary river adventure in rural Spain! Sounds like you were living your best "Hemingway meets mermaid" life. I must say, your packing skills are impressively minimalist. Most people would at least bring a snack, but not you! You're out there living on a diet of words and water, like a literary camel of sorts..
Excellent work! You have successfully set up your GitHub environment as well as Pycharm, connected the two, and installed Python3 on your computer, as "import this" would not have produced the poem otherwise. I will award full points.
Score: 0.5/0.5
nathanielpolley
left a comment
There was a problem hiding this comment.
Beginner objectives complete.
Intermediate objectives pending.
Advanced objectives pending.
Final score: pending/3
There was a problem hiding this comment.
An excellent start here. The correct growth rate is calculated, given the correct user input. You also threw an f-string in there. However, you need to always have the assumption that the user is the most confused person that you know x1000. In this case, I am able to enter non-numerical characters, and the program exits with an error. You will need to make sure that only integer values are processed. You can implement that with using the ".isdigit()" method on the object that you set for all values and incorporate that into your existing conditionals, as well as also coding the appropriate responses to output to the user.
Also, nicely done on making sure that the input is greater than '1', as it was something that I forgot to mention, but you already have the intuition of a true programmer, knowing what will logically make sense when given vague instructions. However, in this case, we don't want a "negative" number of cells or time, so simply change that conditional to "less than zero" and you should be golden.
Please provide me with these updates, and I will award a full score.
Score: pending/1
nathanielpolley
left a comment
There was a problem hiding this comment.
Beginner objectives satisfied.
Intermediate objectives pending.
Advanced objectives pending.
There was a problem hiding this comment.
A good attempt here at validating user input. The logic is correct with using .isdigit(), making sure that the initial values are positive (however, you need to do the same with the final value), and that final is greater than the initial, and we get a correct cell growth value. This is due to remaining issues with the control flow of the if/else statements. Everything is being run sequentially, when I believe you intended to have it nested. E.g. I will enter a negative value for time, then "invalid time (should be more than 0h)" is printed. However, because there are sequential if statements that come after it, I get a red system error "NameError: name 'initial_count' is not defined". This is because, despite your code ideally prompting the user for the positive value, the definition of "initial_count" is never reached in the "else" part of the code block, but then the following if statement expects initial_count to exist.
Here would be my go around for it:
- Define time, initial, and final objects with user input (no checking valid input here)
- First (outer) if/else -> check if string input contains only numbers with .isdigit() (hint: use 'and' to tie together conditionals into one line). This will eliminate negatives as well, as the character "-" fails the isdigit() test. Terminate program if not true.
- Convert all user string inputs to int.
- Second (inner) if/else -> check for if final is greater than initial. Terminate program if not true.
- Perform your calculus at the very inside of these nested if/else statements.
Excellent work so far. I believe in you.
Score: pending/1
nathanielpolley
left a comment
There was a problem hiding this comment.
Beginner objectives complete.
Intermediate objectives pending.
Advanced objectives pending.
Total score: pending/3.5
There was a problem hiding this comment.
Excellent progress with validating the numerical values for the cell counts. The only thing left to do is handle cases for when the user enters non-numerical characters. In this test case, I entered "hdfhf", and the program aborted with an "exit code 1" error with "ValueError: invalid literal for int() with base 10: 'hdfhf'" (see below).
All code should end with "exit code 0" with no red text errors. In this case, you can use .isdigit() to test if the input is numerical, not negative, and no decimals, as any string containing "-" or "." will return False.
Also, be sure to make any changes on the functional ".py" file (not .txt), as when GitHub merges the changes, it allows me to see what has been added or deleted between each version you change.
Almost there..just a small change to make, best of luck.
Score: pending/1
For the #Condition step, it works ok but for the moment I am not able to recall the user to enter a new input if the previous one is not valid
nathanielpolley
left a comment
There was a problem hiding this comment.
Beginner objectives satisfied.
Intermediate objectives pending.
Advanced objectives satisfied.
Final score: pending/3.5
There was a problem hiding this comment.
Very nice use of set and subset implementation to test for proper "ATCG" input. Everything functions how it should.
Score: 2/2
nathanielpolley
left a comment
There was a problem hiding this comment.
Beginner objectives satisfied
Intermediate objectives pending
Advanced objectives pending
Final score: pending/3.5
There was a problem hiding this comment.
I always enjoy looking at your avant gard coding style..it is like a Warhol and a Magritte all put together. Everything runs correctly here. However, I couldn't help to notice that you defined two "find_max" functions, one which found the actual maximum and the other that actually calculated the minimum. Luckily, because you run them sequentially, it has the correct output.
However, a few learning opportunities here. Functions should all be declared at the beginning of the code with unambiguous names, then followed by the code that calls them later. Here, the code is sandwiched between your functions like a Monte Cristo..sure, it can work, but it can easily lead to mistakes downstream. In this case, the second "find_max" function declared overrules the first one when it is called again, thus calculating the minimum. Ideally, it should be "find_max" and "find_min" declared at the beginning and then you can call them as you need them.
A spaghetti code Bolognese..however, your comments were the perfect Herbes de Provence to supplement.
Score: 0.5/0.5

My first try!