Senator Bernie Sanders had a heart attack this week, his campaign said on Friday, as he was released from a Las Vegas hospital. “After two and a half days in the hospital, I feel great, and after taking a short time off, I look forward to getting back to work,” Mr. Sanders said in a statement. His doctors in Las Vegas, Arturo E. Marchand Jr. and Arjun Gururaj, said in the statement that after Mr. Sanders experienced chest pains on Tuesday night, he was given a diagnosis of a myocardial infarction, or heart attack.