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
Sarthak Baral
Expert
last year
Sarthak Baral answered

Hi Nuthakki,

No. To print a number, do not use quotes:

print(5)
print(10.5)

Quotes are only for text. If you write "5", Python treats it as a string, not a number.

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

Python
This question was asked as part of the Getting started with Python course.
Roll rider Rider
last year
Rollcountry asked
Abhay Jajodia
Expert
last year
Abhay Jajodia answered

Hi Roll rider,

It should be #include , not studio.h.

#include adds the standard input/output library in C, so you can use functions like printf() and scanf().

If you write studio.h, the compiler cannot find that header, so you get an error.

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

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

Hi Steve,

Use the modulo operator %. It gives the remainder after division.

Example:

print(14 % 3)  # 2

So 14 % 3 is 2, because 14 divided by 3 leaves 2 leftover.

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

Python
This question was asked as part of the Getting started with Python course.
Akash Akas
last year
Akashcountry asked
Abhay Jajodia
Expert
last year
Abhay Jajodia answered

Hi Akash,

Coding matters because it lets you tell a computer what to do, so you can solve problems faster and automate boring tasks.

It also helps you build useful things like websites, apps, games, and tools, and it is a skill used in many careers.

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

Python
This question was asked as part of the Getting started with Python course.
Abhay Jajodia
Expert
last year
Abhay Jajodia answered

Hi Krithi,

java.util.Scanner is used to take input from the user, like reading a number or a word from the keyboard.

class Main is the main container for your program. Java code must be inside a class, and the program starts running from the main() method inside that class.

Example:

import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int x = sc.nextInt();
    System.out.println(x);
  }
}

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

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

Hi Sujan,

Because in Python, # means comment. Anything after # on that line is only a note for humans, so Python ignores it when running the code.

Example:

# this will be skipped
print(34.0)  # this part is also skipped

Only print(34.0) runs.

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

Python
This question was asked as part of the Getting started with Python course.
Abhay Jajodia
Expert
last year
Abhay Jajodia answered

Hi Manfred,

Yes, you can define a function after main(). The only difference is that if main() calls that function, you should write a function prototype above main() so the compiler knows the function exists.

Example:

int findSquare(int n);  // prototype

int main() {
    printf("%d", findSquare(5));
    return 0;
}

int findSquare(int n) {  // definition after main
    return n * n;
}

If the function is defined before main(), you usually do not need the prototype.

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

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

Hi guerfi,

There is no difference. f"..." and F"..." both mean an f-string, and they work the same.

Example:

name = "Alice"
print(f"Hi {name}")
print(F"Hi {name}")

Both print the same output.

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

Python
This question was asked as part of the Getting started with Python course.
Shashank T S
last year
Shashankcountry asked
Abhay Jajodia
Expert
last year
Abhay Jajodia answered

Hi Shashank,

Datatypes tell the computer what kind of value something is, like a number, text, or true/false. This helps the language know what operations make sense.

Common Python datatypes:

  • int for whole numbers like 5

  • float for decimals like 5.6

  • str for text like "hello"

  • bool for True or False

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

Python
This question was asked as part of the Getting started with Python course.
Anupama.s. Gudagur
last year
Anupama.s.country asked
Abhay Jajodia
Expert
last year
Abhay Jajodia answered

Hi Anupama.s.,

Keywords in C are reserved words that have a fixed meaning in the language, so you cannot use them as variable or function names.

Examples: int, return, if, else, for, while, break, continue.

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

C
This question was asked as part of the Learn C Programming course.