Open links in new tab
  1. Python Basics

    Learn basic Python programming with this comprehensive guide. It covers syntax, variables, strings, numbers, booleans, control flow, functions, lists, dictionaries, sets, exceptions, loops, modules, files, di…

    Python Tutorial
    Learn Python Basics - GeeksforGeeks

    Python is a high-level programming language with a simple and readable syntax. It is commonly used for web development, data analysis, automation and machine learning.

    GeeksForGeeks
  1. Here are some basic Python codes to get you started with common tasks.

    Print "Hello, World!"

    This is the most basic program that prints "Hello, World!" to the console.

    print("Hello, World!")
    Copied!

    Add Two Numbers

    This program adds two numbers provided by the user.

    # Input from the user
    num1 = float(input("Enter first number: "))
    num2 = float(input("Enter second number: "))

    # Adding two numbers
    sum = num1 + num2

    # Display the sum
    print("The sum is:", sum)
    Copied!

    Find the Factorial of a Number

    This program calculates the factorial of a given number using recursion.

    def factorial(n):
    if n == 1:
    return n
    else:
    return n * factorial(n-1)

    num = int(input("Enter a number: "))
    print("The factorial of", num, "is", factorial(num))
    Copied!

    Check if a Number is Prime

    This program checks if a given number is prime.

    Feedback
  2. Python Basics

      1. Fundamentals. Syntax – introduce you to the basic Python programming syntax. Variables – …
      2. Operators. Comparison operators – introduce you to the comparison operators and how to use …
      3. Control flow. if…else statement – learn how to execute a code block based on a condition. Ternary …
      4. Functions. Python functions – introduce you to functions in Python, and how to define functions, …
      5. Lists. List – introduce you to the list type and how to manipulate list elements effectively. Tuple – …
  3. Learn Python Basics - GeeksforGeeks

    Feb 7, 2026 · Python is a high-level programming language with a simple and readable syntax. It is commonly used for web development, data analysis, …