Before you tried to login with your laptop, you should have logout with your phone.
Can your phone receive text messages?
Write an email message to send to your mobile device—for example, address it to firstname.lastname@example.org.
Enter "test" in the Subject field
Delete anything in the body, and then send the email.
You can only use mobile numbers as you will get a text messages to get a account key. If you are entering or using a landline for SMS codes then you will not receive it as key code will only be sent to mobile numbers.
While entering email address or mobile number always be attentive and type the correct contact as if your contact info is wrong then you will not receive the code.
In case you are not able to receive mails then check your device problems. Sometimes yahoo doesn’t support some devices so make sure that the device and carrier is supported.
Make certain your alternating email address hasn't been deleted, the email isn't in your spam folder, and Yahoo isn't blocked by your ISP.