How should one practice basic programming??? learning new codes or executing learnt codes??
You must try both.
Executing learnt codes builds your knowledge about various tricks of the compiler and also boosts the need to code programs more efficiently.
And if you stop learning new codes, you won’t proceed (stuck with what you know) further and miss the actual beauty of programming.