Guest User

Untitled

a guest
May 20th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. quiz = {'is three an even number? '=>'no',
  2. 'what is 6 + 3? '=>'9',
  3. 'is this quiz too easy? '=>'yes'
  4. }
  5.  
  6. for i in quiz do |k,v|
  7. print k
  8. answer = gets
  9. puts answer
  10. if answer == v
  11. puts "that is correct!"
  12. else
  13. puts "you lose!"
  14. end
  15. end
Add Comment
Please, Sign In to add comment