Skip to content

Update ex_0_beginner_runfile.py#12

Open
ASLIOZKUL wants to merge 11 commits intonathanielpolley:mainfrom
ASLIOZKUL:main
Open

Update ex_0_beginner_runfile.py#12
ASLIOZKUL wants to merge 11 commits intonathanielpolley:mainfrom
ASLIOZKUL:main

Conversation

@ASLIOZKUL
Copy link
Copy Markdown

Test commıt

Copy link
Copy Markdown
Owner

@nathanielpolley nathanielpolley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beginner objectives satisfied.
Intermediate objectives pending.
Advanced objectives pending.

Total score: pending/3.5

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellently done. Everything works on your end.

Enjoy the poem!

Score: 0.5/0.5

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very excellent start here with if/else cases handing user input validation. One more small change to make. If there is invalid input for any of your first three steps, the variables "cell_count", "cell_count2", and "number" are not defined, as they are outside of the scope of the "if" statements.

When they are called in the final conditional, where cell_count and cell_count2 are expected, the program exits with an error, as nothing exists yet to be compared (see image below).

Therefore, it is just a small juxtaposition change to make. My advice would be to combine all three cases into just one if statement at the beginning using "and" (so all cases must be true to proceed), and if all conditions are satisfied, do the final if statement and calculation inside. In the case that at least one condition is not satisfied, it will prompt your message to the user, and the program will abort gracefully with exit code 1 (no red-text errors).

So close..best of luck.

Score: pending/1

Screenshot from 2024-10-23 13-17-21

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the changes. Simply indent the final if statement to be within the first one, and it will only run if the conditions are satisfied, also add an else statement on that outer if statement to handle any time .isdigit() is false.

Score: pending/1

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I duly appreciate your commitment to excellence with your commits. Everything runs how it should. I will award full points.

Score: 1/1

Copy link
Copy Markdown
Owner

@nathanielpolley nathanielpolley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beginner objectives satisfied.
Intermediate objectives pending.
Advanced objectives pending.

Total score: pending/3.5

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the changes. Simply indent the final if statement to be within the first one, and it will only run if the conditions are satisfied, also add an else statement on that outer if statement to handle any time .isdigit() is false.

Score: pending/1

Copy link
Copy Markdown
Owner

@nathanielpolley nathanielpolley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beginner objectives satisfied
Intermediate objectives satisfied
Advanced objectives pending

Total score: pending/3.5

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I duly appreciate your commitment to excellence with your commits. Everything runs how it should. I will award full points.

Score: 1/1

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good start here. Two more things to do. The program must also handle lowercase atcg input. An easy fix for this is just to convert all inputs by using the .upper() method on the first string that is read in.

Secondly, GC content is the (number of Gs plus the number of Cs) divided by the total number of As Ts Cs and Gs, then multiplied by 100. Again, simple arithmetic to add.

I look forward to seeing your next version.

Score: pending/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants