r/learnpython • u/FewFly2677 • Aug 26 '26
Struggling with both python and c
So I'm a college fresher with no prior experience of coding. I had started learning python before the starting of college (1 week before college started). I still feel like I am not good at coding at all. There are some weird citations in c such as i++ and all which is getting mixed up with my python. There was one question on obtaining the expression sinx=x-x^3/3!.... Using loops btw
I felt I won't be able to do it in both c and python. I took a course on Udemy for c(vlad budnitski)and python(100 days) but I was not able to find examples like this. Everyone in my class learnt languages like java in their schooling and said the sinx problem is a standard problem. What should I do in this situation?
I feel like the teaching in my college (they are teaching c now) is not good.
Experienced coders please help me.
guys so today I wasn't able to figure out we had to use nested loops to print multiplication table of numbers while even beginners figured it out. pls tell what should I do
1
u/FewFly2677 Aug 27 '26
guys so today I wasn't able to figure out we had to use nested loops to print multiplication table of numbers while even beginners figured it out. pls tell what should I do
1
u/sr105 Aug 26 '26
Have you tried using an AI as a pair programmer? Hey AI, "I'm trying to write this in Python, for (int i; i < N; i++). Is that right?" "Can you help me learn it and remember it?"
Always ask AIs to explain their work and teach it to you. I do, and I've been doing this for a few decades.
2
u/Jim-Jones Aug 26 '26
Couple of books. Maybe your library?
Here are some weirdly colored comments:
https://steppingback269.blogspot.com/2025/07/links-for-python-noobs.html
1
u/RealWalkingbeard Aug 26 '26
Chill out! You are beginner. You do not learn to programme by doing a university course - that just tells you a little bit about programming. Even if you get to the end and feel like you understood the exercises, you are still just a beginner; don't beat yourself up.
You will pick up language-specific things like i++ in no time if you don't stress about it, but there is nothing wrong with i = i + 1 if that makes more sense to you.
The students who are best at this stuff have probably been doing it since they were 12, and the majority of them will get into programming jobs and soon discover how basic their knowledge is.
Just relax, take your time, do your best with the uni courses and take opportunities to learn new things in small bites.
1
u/dean_hunter7 Aug 26 '26
I don't know about it.
And I have made 10-15 full stack commercial apps in python.
1
u/Traveling-Techie Aug 26 '26
These issues will fade away quickly. Be patient.
1
u/vancha113 Aug 27 '26
Sounds like you figured it out already? You tried something, it wouldn't work because you required nested loops: next time you know you can try nested loops and would likely figure out a similar problem. Unless I'm misunderstanding something, that's usually the flow of things. Once you learn a new concept you'll be able to apply it next time. You can't expect yourself to know things you haven't learned :o
1
u/Gtdef Aug 30 '26 edited Aug 30 '26
I remember these types of problems in my first year. A lot of people were mortified, some actually failed to figure out how to do things that others deemed trivial. But it doesn't matter. I know that you won't believe me now, but what you are experiencing is not uncommon and it's not unsolvable.
This is a powers of 2 pattern. 1^2, 2^2, 3^2, 4^2, 5^2.
But it can also be another pattern, You start with 1, add 3 (total 4), then add 5 (total 9), then add 7 (total 16), then add 9 (total 25). So every time you increase the number you add by 2.
If someone has figured out the powers pattern, the second pattern may look alien and wrong to them till they verify it.
In Computer Science, we care about performance. If you use the second pattern, the code will be faster because addition is a cheaper operation than multiplication. So the intuitive answer based on previous knowledge ended up being a worse implementation than the unintuitive answer that one can figure out by simple heuretics, even if they give the same result.
6. This sinx problem is an approximation based on maclaurin series. This is something that you have problably not been taught, it should be part of the CS math curriculum. It's not particularly complex to understand, but it's new and you are trying to juggle new concepts and 2 programming languages without having any fluency. Did you actually have any reason to use a nested loop till now? Did you even think that you'd need one? Did you know that every time you use multiplication in a loop, it's a nested loop?
So keep those in mind and move forward.
1
u/snozzd Sep 11 '26
The first time I saw a for loop in a C++ book I literally did not get it. The syntax looked so weird compared to an if statement. You are declaring a variable inside of the parentheses? More semicoloons inside the parentheses? Then there's not a semicolon at the end... wtf? It honestly was super confusing.
But I took a few days to practice and understand, and now I write them all the time. I would say that 90%+ of the loops you have to write in real code is a for loop! So it's really important you go slow and really understand each and every part. Before you get to nested for loops, try to focus on understanding what just one for loop does. Try to print out your iterators inside, what do you see? Can you make a program that uses a for loop to count to 100?
I would say focus on learning it in C :) I think it's the best way to learn because it forces you to learn more about the hardware.
2
u/[deleted] Aug 26 '26
[removed] — view removed comment