Skip to content
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

Kristen Nestler #72

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Kristen Nestler #72

wants to merge 14 commits into from

Conversation

knestler
Copy link

This is my mod 0 work!

Copy link

@corneliusellen corneliusellen left a comment

Choose a reason for hiding this comment

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

Nice work on this @knestler . I can tell you have a solid understanding of Ruby syntax, datatypes, and conventions. Please see my comments and I would encourage you to adjust anything that should be fixed.

@@ -0,0 +1,10 @@

'''puts "Hello World!"

Choose a reason for hiding this comment

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

This is not valid syntax!

cups_of_flour = 2
has_sauce = "yes"

if has_sauce = "yes" && cups_of_flour>=2

Choose a reason for hiding this comment

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

= is the assignment operator. You should be using a different operator here ==.

To prove this, try changing your has_sauce variable to "no", and then running line 70 again - it still returns true! Can you figure out why this is? Comment here!

5. What is the Ruby syntax for an if statement?

if variableX = 2

Choose a reason for hiding this comment

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

Again, do not use the assignment operator for if statements

7. Provide an example of the Ruby syntax for an if/elsif/else statement:

if variableX = 2

Choose a reason for hiding this comment

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

Here too.


# YOU DO: Write code that will reassign the last item in the animals
# array to "Gorilla"

animals[-1]= "Gorilla"

Choose a reason for hiding this comment

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

Nice! 👏


8. What questions do you still have about hashes?
How often are hashes used?

Choose a reason for hiding this comment

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

All the time!!! They are a very useful datatype because they allow a "lookup" that is FAST!
(aka, it's much faster to find something in a hash with 1 million key/value pairs than to find the same thing in an array with 1 million elements)

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