Skip to content

Kristen Nestler#72

Open
knestler wants to merge 14 commits into
turingschool:mainfrom
knestler:main
Open

Kristen Nestler#72
knestler wants to merge 14 commits into
turingschool:mainfrom
knestler:main

Conversation

@knestler
Copy link
Copy Markdown

This is my mod 0 work!

Copy link
Copy Markdown

@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!"
Copy link
Copy Markdown

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
Copy link
Copy Markdown

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!

Comment thread section2/reflection.md

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

if variableX = 2
Copy link
Copy Markdown

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

Comment thread section2/reflection.md

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

if variableX = 2
Copy link
Copy Markdown

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"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice! 👏

Comment thread section3/reflection.md
The number of cars on a lot. Many cars will have different attributes and many will have the same. Using a hash will allow us to use the objects a key instead of the integer.

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

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