Children should be taught to fail as a "life lesson", the Duke of York said.

The Queen's second son told The Sunday Times that failure was good for children, and said that he had learned during his time at school not to be afraid of it.

Andrew was speaking ahead of the launch tomorrow of a new scheme to encourage children to learn digital skills and set up online businesses.

He told the newspaper the thing he had learned most during his time at Gordonstoun school in Scotland was that "failure was not something to be afraid of or to feel guilty about - because so much of life is understanding about failure and the lessons to be learnt from failure".

He called for youngsters to be given tasks at school at which they were set up to fail - which he experienced himself as a pupil when given the job of negotiating a rowing boat out of a harbour without crashing it.

The duke said: "Failure allows you to succeed in the future because we are an experience-based learning organism. All animals are. Give someone the experience and they will learn."

He added: "There is a desire for everyone to succeed, which is entirely right and proper, but there must be a learning process to success and part of that must be being challenged in some way so that the logical outcome will be failure, so that you can learn from that failure."

Andrew's new education scheme is modelled on his father's Duke of Edinburgh awards, The Sunday Times said, and will offer prizes of up to £20,000 for the best ideas for new digital companies.

He has drafted in A-list celebrities to help, including American pop star Will.i.am, and hopes that the scheme, which will award badges in recognition of the entrepreneurial skills the youngsters attain, will reach up to a million children.

It will be announced at Buckingham Palace tomorrow.