Every person violates a chapter, section, division, paragraph or provision of this city code when he or she performs an act thereby prohibited or declared unlawful, or fails to act when the failure is thereby prohibited or declared unlawful and, upon conviction thereof, shall be punished as for a misdemeanor or as for a petty misdemeanor, except as otherwise stated in specific provisions herein, as set forth in the specific chapter in which the section, division, paragraph or provision violated appears. Upon conviction for a crime, the actor may be convicted of either the crime charged if it is a misdemeanor or a petty misdemeanor as an included offense necessarily proved if the misdemeanor charge were proved.