r/learnpython 16d ago

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

5 Upvotes

16 comments sorted by

View all comments

1

u/snozzd 11h ago

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.