7. let me pass but nothing comes up except a # why?


7 why does my code not print anything

does not print username and password

class Computer
@@users = {}
def initialize(username,password)
 @username = username
 @password = password
 @files = {}
 @@users[username] = password
def create (filename)
        time = Time.now
        @files[filename] = time
        puts "You just created a new file, #{filename} at #{time}!"
 def Computer.get_users
my_computer = Computer.new("Buffetyy", 301728)
 print Computer


You want to print the username and password, you are currently trying to print a class Computer.

You created a Computer object when you declared

my_computer = Computer.new("Buffetyy", 301728)

That line of code created a Computer called my_computer with a username of Buffetyy and a pass word of 301728

Try referencing your Computer object and calling on its methods to display the data you want.

it will look something like this


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.