"Harry Potter and the Sorcerer's Stone", "author" => "J.K. Rowling", "page_count" => 320} book["author"] => "J.K. Rowling" book["isbn"] = "0439708184" => "0439708184" book => {"title"=>"Harry Potter and the Sorcerer's Stone", "author"=>"J.K. Rowling", "page_count"=>320, "isbn"=>"0439708184"}
else otherwise. def analyze_book(book) if book["page_count"].even? puts "This book has an even number of pages." else puts "This book has an odd number of pages." end end
are considered false: false, nil •Things that are considered true: everything else. (1, -10,“Hello”, [], true) if true puts "This code will always run." else puts "This book will never run." end