this was so great! I have been putting off learning Rust because I don't have a whole lot of C/C++ experience but this really gave me the confidence to dive in, thanks! please keep this going, would love to work along the rest of the algorithms.
I am busy learning Rust coming from Python and I really like these videos. Just one note though. You indicated on line 9 of the Python code that the if test_dict['Key_3'] checks if the string of 'Key_3' is within the dictionary. This actually just retrieves the underlying value which in this case is a list. And because the list has values it is considered truthy which is why it works here. To look whether a key is in a dictionary you can either use a try except and catch the key error or in this scenario I would use the in keyword. So you would have to write if 'Key_3' in test_dict
Thanks. Only one thing that I really don't like in rust hashmaps: their syntax. Declaration and dict manipulation are more pure in python, js, dart, go and it's really not presentable to interact with dict in rust way.
In case someone is having the problems compiling the code: (as of writing this): ```rand::thread_rng().gen_range``` takes one argument, so it will be ```rand::thread_rng().gen_range(0..nucleuotides.len())``` HashMap needs to be imported, so write ```use std::collections::HashMap;``` on top of the file.
this was so great! I have been putting off learning Rust because I don't have a whole lot of C/C++ experience but this really gave me the confidence to dive in, thanks! please keep this going, would love to work along the rest of the algorithms.
I am busy learning Rust coming from Python and I really like these videos.
Just one note though. You indicated on line 9 of the Python code that the if test_dict['Key_3'] checks if the string of 'Key_3' is within the dictionary. This actually just retrieves the underlying value which in this case is a list. And because the list has values it is considered truthy which is why it works here. To look whether a key is in a dictionary you can either use a try except and catch the key error or in this scenario I would use the in keyword.
So you would have to write if 'Key_3' in test_dict
These videos are under viewed. Appreciated what you did in this short series.
Thanks. Only one thing that I really don't like in rust hashmaps: their syntax. Declaration and dict manipulation are more pure in python, js, dart, go and it's really not presentable to interact with dict in rust way.
Please go on with this series.
You could use a enum to either store only one string or a vector of strings
vscode theme name pls
In case someone is having the problems compiling the code: (as of writing this):
```rand::thread_rng().gen_range``` takes one argument, so it will be ```rand::thread_rng().gen_range(0..nucleuotides.len())```
HashMap needs to be imported, so write ```use std::collections::HashMap;``` on top of the file.
Seems like you forgot the "use.." statement at the top? 😉
@@climatechangedoesntbargain9140 Really? I think it's present in my comment.