+ 1

When you are given an exercise to write a specific code in Python how can you solve it with the least complications ?

a beginner in Python and i need help i sometimes tend to complicate things

30th May 2018, 12:35 AM
AzZa BN
AzZa BN - avatar
8 Respostas
+ 3
The good thing about a complicated solution is that it’s a solution. Once you’ve solved the problem your way, look at it and identify its little pieces (if you haven’t done that while writing the code). Then google each minor action for the standart pythonic way to do that. With time it should become more natural to do things in a standart way.
30th May 2018, 1:06 AM
Pedro Demingos
Pedro Demingos - avatar
+ 4
Okay. What I am thinking is that you can get practice with programs even smaller and easier than classic beginners problems... Those that will necesitate 2 to 3 lines of codes max and only one programming elements like just conditional loops or just loops and build from there to programs that are a mix of these. I think starting with stuff that can hardly be complicated can help. So, check out the exercises in this link. They are ordered by topics and complexity I believe. They also have solutions and that should help. And again, be patient with yourself. â˜ș https://www.w3resource.com/JUMP_LINK__&&__python__&&__JUMP_LINK-exercises/
30th May 2018, 2:01 AM
cyk
cyk - avatar
+ 3
Well, it is generally a good idea to solve a problem on paper before starting coding. It can be very helpful. Now, you can also post your codes and ask us to help you optimize them. And after a few of those you will see the kind of complications you create and work to avoid them in your future codes. All that said, do give yourself a break. All beginners tend to write programs that are more complicated than they should be. With the time you will get better. Cheers! â˜ș
30th May 2018, 1:09 AM
cyk
cyk - avatar
+ 3
AzZa And you feel you complicate things even more than other beginners do?
30th May 2018, 1:43 AM
cyk
cyk - avatar
+ 1
Having an idea that is difficult to use can mean two things: 1. You can’t turn your idea into an algorithm. This will get better with time, specially if you go into a lot of tutorials that give good examples of how to write down specific actions. 2. You know exactly what to do but don’t know the functions for that. This will happen from times to times, specially when you start having complex ideas. One thing you can do then is to know the right terms for what you want to do, so you can google it or ask on forums. There will probably a function in a module somewhere that takes care of that.
30th May 2018, 1:59 AM
Pedro Demingos
Pedro Demingos - avatar
0
Pedro Demingos I don't solve it all just part of it sometimes i stop in the middle of it becuz i have an idea that is difficult to make nd thanks for answering
30th May 2018, 1:38 AM
AzZa BN
AzZa BN - avatar
0
cyk thank you m studying python in my college so all the exercises m doing are for beginners like me and according to what i have studied thats whats frustrating me đŸ˜«
30th May 2018, 1:41 AM
AzZa BN
AzZa BN - avatar
0
cyk yes and i even do that in exams and thats depressing even though i understand the lessons well and becuz i want to have a career in programming i want to have experience as much as possible and get some clues to help me abt it
30th May 2018, 1:49 AM
AzZa BN
AzZa BN - avatar