-
Notifications
You must be signed in to change notification settings - Fork 35
Python #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Python #21
Changes from all commits
f0e6174
7531881
c96a9f4
0591600
e295a68
3c96b9a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| import this | ||
|
|
||
| print("\n"+"TYPE YOUR RESPONSE TO PROMPT 1 HERE") | ||
| print("\n"+"Hello my name is Hélène and I'm in M1 of CARe. I want to learn programming language because today informatics take a huge space in our lives but also in biology which is a field that I learn and I want to work in.") | ||
|
|
||
| print("\n"+"TYPE YOUR RESPONSE TO PROMPT 2 HERE") | ||
| print("\n"+"The last place where I was without a computer available was at the beach in Spain in august.") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,27 @@ | ||
| Copy and paste output of ex_0_beginner_runfile.py below: | ||
| The Zen of Python, by Tim Peters | ||
|
|
||
| Beautiful is better than ugly. | ||
| Explicit is better than implicit. | ||
| Simple is better than complex. | ||
| Complex is better than complicated. | ||
| Flat is better than nested. | ||
| Sparse is better than dense. | ||
| Readability counts. | ||
| Special cases aren't special enough to break the rules. | ||
| Although practicality beats purity. | ||
| Errors should never pass silently. | ||
| Unless explicitly silenced. | ||
| In the face of ambiguity, refuse the temptation to guess. | ||
| There should be one-- and preferably only one --obvious way to do it. | ||
| Although that way may not be obvious at first unless you're Dutch. | ||
| Now is better than never. | ||
| Although never is often better than *right* now. | ||
| If the implementation is hard to explain, it's a bad idea. | ||
| If the implementation is easy to explain, it may be a good idea. | ||
| Namespaces are one honking great idea -- let's do more of those! | ||
|
|
||
| Hello my name is Hélène and I'm in M1 of CARe. I want to learn programming language because today informatics take a huge space in our lives but also in biology which is a field that I learn and I want to work in. | ||
|
|
||
| The last place where I was without a computer available was at the beach in Spain in august. | ||
|
|
||
| Process finished with exit code 0 |
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For this, you have all of the calculations correct. However, you need to make sure that it handles all incorrect user input correctly. For instance, if the user enters "abc", then that cannot be converted to a float, so an error will be thrown. You also cannot take logs of negative numbers, and you can only have whole number integers for numbers of cells. This will be your outer if/else statement that will use isdigit( ) in order to evaluate if the user has input a numeric positive integer value. Also, since this is a "growth" calculator, the final value must always be larger than the initial value, so this will be an internal if/else statement that (after converting to a numerical value) will evaluate if the final is greater than initial. Keep up the good work, and I will revisit this for a final mark once you have implemented the correct conditionals. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,16 @@ | ||
| #YOUR CODE FOR EX_0 INTERMEDIATE HERE | ||
| import math | ||
|
|
||
| initial_count = input("Enter the initial cell count:") | ||
| final_count = input("Enter the final cell count:") | ||
| time = input("Enter the time elapsed ( in hours):") | ||
|
|
||
| initial_count = float(initial_count) | ||
| final_count = float(final_count) | ||
| time = float(time) | ||
|
|
||
| growth_rate = (math.log(final_count) - math.log(initial_count)) / time | ||
|
|
||
| if growth_rate is not None : | ||
| print(f"The growth rate of the microbial culture is : {growth_rate} per hours") | ||
| else : | ||
| print("Invalid input") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Score: 0.5/0.5