When a comma precedes "but," "but" is connecting two independent clauses. When a comma appears after "but," it typically indicates the use of an introductory element or a parenthetical phrase.
Both words are used to convey the past tense and past participle of the verb learn. The choice between these two spellings often depends on regional differences in English usage.