Struggling to Understand Functions—Any Tips or Resources?

0
2
Asked By CuriousCoder92 On

Hey everyone! I'm having a tough time wrapping my head around functions in programming. While I can handle simple for loops just fine, I feel completely lost when it comes to more complex tasks involving functions. I'd appreciate any tips on where to find better information or recommended YouTube videos that explain complex functions more clearly. Thanks!

1 Answer

Answered By TechWhiz123 On

Functions are basically chunks of code that you give a name to, allowing you to reuse them throughout your program. They can take inputs, known as arguments, and perform operations on them. For instance, a simple function could return the number 3 every time you call it. If you had a function that doubled a number, you’d call it with an input and get back double that number. Can you share what specifically confuses you about writing functions?

LearningLingo -

I get the idea of functions, but writing one is where I struggle. For example, I need to create a function that takes an array and returns it in reverse without using the built-in reverse() method. I can get the answers from chats or Google, but I still feel lost. How do I learn from that?

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.