Hey Hashnode, I'm a computer science undergraduate, and every time a bug occurs while I program, I quit and ask my smart friends to fix it for me. I also take my friends' help with assignments. I'm an average student as well. What should I do to develop a never-give-up attitude?
Attitude is everything and is the hardest thing to learn. Skills are far easier to learn. That said, hopefully I can help.
I'll get into the issues you're facing generally, as well as your mindset and what's wrong there (might be quite a long answer.)
So, read this book: The mental game of poker. Ignore most of the poker references if you don't understand the game but the tl;dr is there is no tl;dr. This book, and the next one in the series, will help you understand your mindset and how to make gradual yet significant improvements in both the short and long term. These aren't books that you just read once.
In your case I would suggest you read the section on accumulative tilt. This occurs when someone feels down about not being able to do something, in your case fix a bug, but this increases over time due to ALL the bugs you haven't fixed so you begin to feel worse and worse. This isn't good. There are ways to fix that in the book by recognising yourself and your previous achievements as well as having a clear head in the when you hit bugs in the future.
With respect to the specific cases you gave, understanding how to fix bugs comes with experience as well as having a fundamental understanding of what you are doing. Since you never fix your own bugs you never learn, so you stagnate instead of constantly improve.
So instead of quitting and asking your friends to fix it for you, instead you need to read the error message, make sure you understand it, find out where in your code this issue originated from, understand and account for all variables/constants/dependencies that affect that origination point and then if that all makes sense either consult the documentation for that programming language you are using and/or paste the error (as general as possible) into a search engine to see if other people have had a similar issue.
Taking help from friends is nothing to be ashamed of, working together is a good thing.
Nobody is an average student. So, don't call yourself that :)
Programming is actually a lot about perseverance.
As far as your assignments or the programs you write in your hands on sessions in university go, what you're doing is not something out of the ordinary. I wouldn't think you would give up or ask your friends to do it, if there was no grading or there was ample time available to solve your assignments.
I think you should start building side-projects. You're doing it just for yourself - there is no teacher or a boss supervising over you. Besides, you have the freedom to do whatever you want to do. I don't think you'll slack off or give up, there :)
If that doesn't work, a time will come when you've to start working, during which you'll have no choice but to fight it out and not quit.
Jakob Lind
Full stack developer and independent consultant.
When asking your smart friends for help, do you ask to learn or ask to just get the problem solved without understanding how? That's an essential difference there. Asking smart people for help is not giving up if you do it with the intention to learn. When you start working you will ask people for help ALL the time. And you will help people a lot to. Communication is essential in working in teams.
Just the fact that you post here to try to learn how to improve suggests to me that you have the right attitude. You are not giving up!
So keep asking your friends, and talk with them about the problems you are facing. Learn from them! Also try to help them as well when they get stuck.
Good luck!