0d: 00h: 00m: 00s

🎁 Get 3 extra months of learning — completely FREE

That's 90 extra days to master new skills, build more projects, and land your dream job.

Become a PRO
Background Image

🎁 Get 3 extra months of learning completely FREE

Become a PRO

Ask Programiz - Human Support for Coding Beginners

Explore questions from fellow beginners answered by our human experts. Have some doubts about coding fundamentals? Enroll in our course and get personalized help right within your lessons.

  • All
  • Python
  • C
  • Java
  • CPP
  • SQL
  • JS
  • HTML
  • CSS
Abhay Jajodia
Expert
4 hours ago
Abhay Jajodia answered

Python doesn’t care about singular/plural. languages is the list name, and language is just a variable you chose to store each item one by one, and you can name it anything like item or x. People often use language because it makes the code easier to read.

Example:

languages = ["English", "German", "French"]
for item in languages:
    print(item)

If you have more questions, I am here to help.

Python
This question was asked as part of the Learn Python Basics course.
Abhay Jajodia
Expert
4 hours ago
Abhay Jajodia answered

Yes, it changes the meaning a lot. line-height: 1.5; is unitless, so it means 1.5 times the font size, but line-height: 1.5px; forces the line height to be only 1.5 pixels, which is tiny and crushes the text. That’s why lessons usually use the unitless version for readable, scalable spacing.

If you have more questions, I am here to help.

CSS
This question was asked as part of the Learn CSS course.
U
Expert
last week
Udayan Shakya answered

Hi Alan, that’s a great question.

In Python, powers work a little differently from what you see on most calculators. Calculators usually use the ^ symbol for exponents, so it’s normal to try the same thing in Python. The tricky part is that Python doesn’t use ^ for powers at all, so it won’t give the result you expect.

The Python way to calculate a power is with two stars. So if you want “4 to the power of 3,” you write:

4 ** 3

Python reads that as “multiply 4 by itself three times,” which gives:

4 * 4 * 4 = 64

You can do the same with decimals:

2.5 ** 3   # 15.625

Once you get used to **, it becomes pretty straightforward.

If you have more questions while you’re learning, I’m happy to help.

Python
This question was asked as part of the Learn Python Basics course.
Abhay Jajodia
Expert
last week
Abhay Jajodia answered

Great question. This trips a lot of people up when they first start using Python.

The key thing to remember is that range() stops one number before the value you put in as the second argument. So if you write:

range(1, n)

Python will count like this:

1, 2, 3, ..., n-1

It never reaches n, which is why your loop feels like it’s stopping too early.

If you actually want to include n in the loop, just add 1 to the stop value:

for i in range(1, n + 1):
    total_sum += i

Now Python will count:

1, 2, 3, ..., n

and you get the full sum you expected.

If anything still feels confusing, I’m happy to walk through another example with you.

Python
This question was asked as part of the Practice: Python Basics course.
Abhay Jajodia
Expert
last week
Abhay Jajodia answered

Hello Varun, really nice question.

A lot of beginners run into this when they start working with functions in C, so you’re definitely on the right track noticing it.

Here’s the simple idea:
If you write a function like this:

int getProduct(float a, float b)

C expects that function to return an int, no matter what you actually calculate inside it. So even if a * b produces a floating-point value, C will convert it to an integer when returning it. That’s why the decimal part disappears.

If you want the full, precise result, you need the function to return a floating-point type:

double getProduct(double a, double b) {
    return a * b;
}

This keeps the decimal values and avoids losing accuracy.

And one more thing students often miss:
You have to actually use the returned value, otherwise it's wasted:

double result = getProduct(3.5, 4.6);
printf("Product: %.2f\n", result);

If anything about return types still feels unclear, feel free to ask — I’m happy to help you understand it fully.

C
This question was asked as part of the Learn C Programming course.
Abhay Jajodia
Expert
last week
Abhay Jajodia answered

Hello Ivan, really nice question.

It’s easy to mix up the idea of a function “returning” with what \n does in a print statement. They sound similar, but they’re completely different things.

When you write:

printf("Hey\nHow are you?");

the \n does not return from the function. It doesn’t stop anything, and it doesn’t exit the print. All it does is tell the output: start a new line here. So the text comes out like this:

Hey
How are you?

The printing continues normally after the newline.
A real return is something you do with a return statement inside a function, not with \n.

If you want more examples or want to see how multiple \n behave, I’m happy to show you.

C
This question was asked as part of the Learn C Programming course.
Abhay Jajodia
Expert
last week
Abhay Jajodia answered

Hello Omar, really nice question.

The logic behind SELECT in SQL is actually pretty simple once you see what problem it solves. A database table is like a giant spreadsheet. Most of the time, you don’t need every single piece of information in that table — you just need certain columns or certain rows.

SELECT is how you tell the database: “Show me only the parts I care about.”

For example, if a table has ten different columns but you only want to see age and country, you can write:

SELECT age, country
FROM Customers;

Now the database gives you just those two columns instead of the whole table. It’s efficient, it’s cleaner, and it makes it easier to work with your data.

So the real logic is:
Ask for the specific data you want instead of taking everything.

If you want to dig deeper into filtering, sorting, or selecting rows, I’m happy to help you explore that next.

SQL
This question was asked as part of the Learn SQL Basics course.
Abhay Jajodia
Expert
last week
Abhay Jajodia answered

Hello Omar, really nice question.

Using * in SQL grabs every column in the table. It works, but it often gives you more data than you actually need. When you switch to something like:

SELECT age
FROM Customers;

you’re telling the database exactly what you want. That makes your query faster, easier to understand, and avoids pulling in extra or sensitive information by accident.

So the idea is simple:
Only ask for the columns you actually need.
It keeps the query clean and efficient.

If you have further questions, I'm here to help.

SQL
This question was asked as part of the Learn SQL Basics course.
Abhay Jajodia
Expert
last week
Abhay Jajodia answered

Hello Pratik, really nice question.

charAt() is a method in Java that lets you grab a single character from a string. You just give it the position you want, and it hands you back the character at that spot.

Java starts counting from zero, so:

  • the first character is at index 0

  • the second is at index 1

  • and so on

For example:

String text = "Hello";
char c = text.charAt(1); // 'e'

If you try an index that doesn’t exist, Java throws an error because the string doesn't go that far.

You’ll use charAt() a lot when you loop through a string and check each character, like when counting vowels.

If you have further questions, I'm here to help.

Java
This question was asked as part of the Java Interview Questions course.
Abhay Jajodia
Expert
last week
Abhay Jajodia answered

Hello Danielle, really nice question.

Any time you use a comparison in Python — things like ==, >, <, >=, and so on — Python evaluates that expression and decides whether it’s true or false. The result of that decision is always a Boolean value: True or False.

For example:

total = 150
result = total > 100
print(result)   # True

Here Python checks the comparison, finds that 150 really is greater than 100, and gives you True. If the comparison wasn’t correct, you’d get False instead.

That’s just how comparisons work in Python:
they always produce a Boolean value.

If you have further questions, I'm here to help.

Python
This question was asked as part of the Learn Python Basics course.