This forum is now read-only. Please use our new forums! Go to forums
Tests broken for section 3/5 ?
My method for print_tweet:
def print_tweet(tweet) puts tweet[“user”][“screen_name”] + “ - “ + tweet[“text”] end
Prints this output:
“raffi - want to work on large scale? “Of course, we still have plenty more to do.” #JoinTheFlock http://t.co/cEoSgiip“
But I still get the error: “Oops, try again. You did not generate the correct output. Did you print the username, followed by ‘ - ‘, followed by the Tweet text?”
Is this broken for anyone else?
Answer 547c17c99c4e9dfa0600bae7
If you search for 3/5 in the forum you will find this:
“Introduction to Twitter’s API 3/5 Reading a Tweet, something wrong.” from lane zhang posted 3 months ago. A guy posted the solution. Here it is
puts “Raffi Krikorian - “ + tweet[“text”]
UPDATE:
Ok, it seems that I cannot find the post I was referring to so here why it is broken.
As raincrash said below, Codecademy is comparing the string of the old username of Raffi Krikorian. Since he changed it to display it upside down you have to force the result. That is why you should write :
puts “Raffi Krikorian - “ + tweet[“text”] and not
puts tweet[“user”][“screen_name”] + “ - “ + tweet[“text”]
Answer 54791654631fe99b59000b6a
Answer 556ce7f576b8fe72c1000077
puts “Raffi Krikorian” + “ - “ + tweet[“text”]
This is another solution that passes
1 comments
This worked for me too. Looks like it is sensitive to the spaces between the “ - “ too.
Answer 5589924fd3292f89720002e2
Answer 547374c280ff33ccb3000220
I got the same error, but this was my output:
uɐᴉɹoʞᴉɹʞ ᴉɟɟɐɹ - want to work on large scale? “Of course, we still have plenty more to do.” #JoinTheFlock http://t.co/cEoSgiipnil
And I used puts tweet["user"]["name"] + ' - ' + tweet["text"]
instead.
Answer 5478770d9c4e9dbc9f006789
Got the same thing, so annoying, thought somethign wrong with my syntax, since I am newbie at Ruby. But, assuming you guys have the same problem it is not about the syntax.
def print_tweet(tweet)
# ADD CODE TO PRINT THE TWEET IN "<screen name> - <text>" FORMAT
puts tweet['user']['name'] + ' - ' + tweet["text"]
end
I got the same output uɐᴉɹoʞᴉɹʞ ᴉɟɟɐɹ - want to work on large scale? “Of course, we still have plenty more to do.” #JoinTheFlock http://t.co/cEoSgiip nil
Answer 5503477a51b887e17d002df1
i make it works but i have the error any way what should i do ?
this have a bug so if you want to pass have to write this instead: puts “Raffi Krikorian - “ + tweet[“text”]
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency
6 comments
That’s a bit of a cheat though, isn’t it? Why is the Raffi Krikorian in the output upside down?
It works! Maybe Raffi changed his username recently and Codecademy is string comparing with the old one.
It works.
Geez, thank you guys. I thought I was getting humbled in Ruby all over again. There’s got to be a way that students can report issues like this.
thank bro, this a bug them see down there i put a Screen shot of the problem
Thnks!…