The swimmer Ryan Lochte was given a 10-month suspension, which will prohibit him from taking part in the 2017 world championships in Budapest.