Encourging Growth mindset, in computing lesson I sometimes have pupils, that struggle to learn because they have a fixed-mindset (“I can't program”, “I can't use computers”, …). 

I the context of teaching a Computing (Computer Science, IT, Digital Literacy, Computational Thinking  ) lesson, what can be done to encourage growth-mindset?



Footnotes:

Growth-mindset / fixed-mindset, are from research by Carol Dweck. Dweck's work shows that a students belief about whether they can do it has a massive effect on outcome. I think some one else said “Whether you believe that you can do it, or that you can not, you are correct.”, this sums it up.
I like both of the existing answers, but I wanted to add another technique that I think is very important: you should show that making mistakes or not knowing is part of the process.

Don't: Make your lessons all about perfect example code and only best practices.

I'm a student in your class. I've understood most of what you told me in lecture. Now I'm at home, sitting down at my computer looking at a homework assignment. I have no idea what to do! Then I start writing code, and I get a ton of errors. Ugh, maybe this computer stuff isn't for me!

Do: Include mistakes, debugging, and looking stuff up in your lessons. Do live coding exercises.

I'm a student in your class. Now I'm at home, sitting down at my computer looking at a homework assignment. I have no idea what to do, but I remember from class you told me I should break problems down into smaller steps and then take those steps on one at a time. Now I'm writing code, and I get an error. Good thing you showed me that errors are a normal part of programming, along with how to debug the issue. I even know how to look stuff up in the reference if I'm confused!