Skip to main content

Python print() Function

When you start learning Python, one of the first things you need to learn is how to display information on the screen. For example, you might want to display: A welcome message. Your name and age. The result of a mathematical calculation. Student marks and results. Information generated by a Python program. Python provides a built-in function called print() for displaying information. The print() function is one of the simplest and most frequently used functions in Python. It helps programmers display information while testing programs, solving problems, and developing applications. In this article, we will learn how to use print() with practical examples and their outputs. 1. What Is the print() Function in Python? The print() function is a built-in Python function that displays information in the output area, usually the terminal or console. Let's look at a simple example. print("Hello, World!") Output: Hello, World! In this example, Python displays the text Hello,...

How to Create Your First GitHub Repository

After creating your GitHub account, the next step is to create your first repository.

A repository is where your project lives on GitHub. It stores your source code, documents, images, configuration files, and the complete history of your project. Whether you're building a simple calculator or a large enterprise application, every GitHub project starts with a repository.

In this guide, you'll learn what a repository is, how to create one, and what every option on the repository creation page means.


What is a GitHub Repository?

A repository (commonly called a repo) is a storage space for a project on GitHub.

It contains everything related to your project, including:

  • Source code

  • Images

  • Documentation

  • Configuration files

  • Project history

  • Branches

  • Issues

  • Pull Requests

Think of a repository as the main folder that holds everything required for your project.


Real-Life Analogy

Imagine you're a student.

You have a folder labeled:

Computer Science Project

Inside that folder, you keep:

  • Assignment

  • Notes

  • Images

  • Diagrams

  • Reports

Similarly, a GitHub repository is a digital folder where all your project files are stored.


Why Do You Need a Repository?

A repository helps you:

  • Organize your projects

  • Store files securely

  • Share your work with others

  • Track project history

  • Collaborate with developers

  • Showcase your projects

Every GitHub project begins with a repository.


Types of Repositories

GitHub provides two main types of repositories.

1. Public Repository

Anyone on GitHub can view your project.

Best for:

  • Learning

  • Open-source projects

  • Portfolio projects

  • Educational content

Example:

Student-Management-System

Anyone can explore your code.


2. Private Repository

Only people you invite can access the project.

Best for:

  • Personal work

  • Company projects

  • Client applications

  • Confidential code

Private repositories are useful when you don't want your code to be publicly visible.


Step 1: Sign In to GitHub

Visit:

https://github.com

Log in using your GitHub account.


Step 2: Create a New Repository

After logging in:

  1. Click the + icon in the top-right corner.

  2. Select New repository.

You can also click the green New button from your repositories page.

GitHub will open the Create a New Repository page.


Understanding Every Option

The repository creation page contains several options. Let's understand each one.


Repository Owner

The owner is the account that will own the repository.

Example:

Owner

johnsmith

If you belong to an organization, you may also see the organization listed here.

Most beginners simply keep themselves as the owner.


Repository Name

This is the name of your project.

Example:

student-management-system

Choose a meaningful name.

Good examples:

calculator

portfolio-website

weather-app

library-management-system

java-notes

Avoid names like:

project1

test

newfolder

abc

myproject123

A descriptive repository name makes it easier for others to understand your project.


Description (Optional)

The description briefly explains your repository.

Example:

A Java-based Student Management System developed for learning object-oriented programming.

Although optional, adding a description is a good practice.


Public or Private

GitHub asks you to choose the repository's visibility.

Public

  • Anyone can view the repository.

  • Great for learning and showcasing projects.

Private

  • Only invited collaborators can access the repository.

  • Suitable for confidential work.

If you're building a portfolio, public repositories are usually the better choice.


Initialize This Repository

GitHub provides three optional settings.

Understanding these options is important.


Add a README File

A README is the first file visitors usually read.

It explains:

  • What the project is

  • Features

  • Installation instructions

  • Usage

  • Screenshots

  • License

Example:

# Calculator

A simple calculator built using Java.

Features

- Addition
- Subtraction
- Multiplication
- Division

For beginners, it's recommended to create the repository with a README file.


Add .gitignore

A .gitignore file tells GitHub which files should not be tracked.

Examples include:

  • Temporary files

  • Build folders

  • Cache files

  • Log files

GitHub provides templates for many programming languages and frameworks.

Examples:

  • Java

  • Python

  • Node.js

  • Android

  • Visual Studio

  • React

Choose one that matches your project.

If you're unsure, you can skip it for now and add it later.


Choose a License

A license explains how others can use your project.

Popular licenses include:

  • MIT License

  • Apache License 2.0

  • GNU GPL

  • BSD License

If you don't understand licenses yet, it's perfectly fine to skip this step and learn about them later.


Step 3: Click "Create Repository"

After filling in the details, click the Create repository button.

Congratulations!

You've successfully created your first GitHub repository.


What You'll See Next

After the repository is created, GitHub opens the repository homepage.

Here you'll find:

  • Repository name

  • README file

  • Code tab

  • Issues tab

  • Pull Requests tab

  • Actions tab

  • Projects tab

  • Wiki tab

  • Settings tab

Don't worry if these sections seem unfamiliar. We'll explore each one in upcoming articles.


Repository URL

Every repository has a unique web address.

Example:

https://github.com/johnsmith/student-management-system

You can share this URL with classmates, teachers, employers, or collaborators.


Repository Structure

A typical repository might look like this:

Student-Management-System/

│── src/

│── images/

│── docs/

│── README.md

│── LICENSE

│── .gitignore

As your project grows, you'll add more folders and files.


Best Practices for Naming Repositories

A good repository name should:

  • Be meaningful

  • Be short and descriptive

  • Use lowercase letters

  • Use hyphens instead of spaces

  • Reflect the project's purpose

Examples:

portfolio-website

expense-tracker

weather-dashboard

inventory-system

python-practice

Common Beginner Mistakes

Using Random Repository Names

Names like:

test

abc

project

demo

make it difficult to identify projects later.

Always choose descriptive names.


Forgetting the README

A repository without a README doesn't explain what the project does.

Adding a README helps visitors understand your work immediately.


Choosing the Wrong Visibility

Think carefully before selecting Public or Private.

You can change the visibility later, but it's better to choose the appropriate option from the beginning.


Creating Multiple Repositories for the Same Project

Each project should generally have its own repository.

Avoid creating unnecessary duplicate repositories.


Leaving the Description Empty

A short description improves the appearance of your repository and helps others understand its purpose.


Frequently Asked Questions (FAQs)

Can I rename a repository later?

Yes. GitHub allows you to rename a repository from the repository settings.


Can I delete a repository?

Yes. Repository owners can permanently delete repositories through the settings page.

Be careful—once deleted, recovery may not always be possible.


Can I change a Public repository to Private?

Yes. GitHub allows you to change repository visibility through the repository settings, subject to your account permissions and plan.


How many repositories can I create?

GitHub allows you to create multiple repositories, making it easy to organize different projects separately.


Should I create one repository for every project?

Yes. Keeping each project in its own repository makes management, collaboration, and maintenance much easier.


Summary

A repository is the foundation of every GitHub project. It stores your code, documents, and project history in one organized location. Learning how to create and configure repositories correctly is an essential GitHub skill.

By choosing a meaningful name, writing a clear description, selecting the appropriate visibility, and including a README, you'll start your projects with a professional structure.

Comments

Popular posts from this blog

Understanding Comments in Java: A Beginner’s Guide

When learning Java programming, one of the first concepts you’ll come across is comments . Comments may not affect how a program runs, but they play a crucial role in making code more understandable, readable, and maintainable. Let’s dive deeper into what comments are, why they’re important, and the different types of comments in Java. What are Comments in Java? A comment in Java is a piece of text written within a program that is ignored by the compiler . In other words, comments are notes for humans, not instructions for machines. They help developers explain the purpose of code, describe logic, or temporarily disable certain lines of code without deleting them. Why are Comments Important? 📌 Readability – Comments make code easier to understand for you and others. 📌 Maintenance – When you revisit your code after months, comments remind you what you were doing. 📌 Collaboration – In team projects, comments explain code to fellow developers. 📌 Debugging – You c...

Java Program to Check Voting Eligibility

In this program, we’ll take the user’s age as input and check whether the person is eligible to vote or not. In India, the minimum age required to vote is 18 years . 💻 Program Code // Java Program to Check Voting Eligibility import java.util.Scanner; public class VotingEligibility { public static void main(String[] args) { // Create Scanner object to take input from user Scanner sc = new Scanner(System.in); // Ask user to enter age System.out.print("Enter your age: "); int age = sc.nextInt(); // Check eligibility if (age >= 18) { System.out.println("You are eligible to vote."); } else { System.out.println("You are not eligible to vote yet."); System.out.println("You can vote after " + (18 - age) + " year(s)."); } sc.close(); // Close the scanner } } 🧠 Explanation import java.util.Scanner; → Imp...

Java Program to Calculate Total Marks and Average of Five Subjects

💡 Program Explanation In this program: The user will input marks of five subjects . The program will calculate the total marks and average . It will then display both results clearly. 🧑‍💻 Java Code: // Java Program to Calculate Total Marks and Average of Five Subjects import java.util.Scanner; // Importing Scanner class for user input public class TotalAndAverage { public static void main(String[] args) { // Creating Scanner object to take input from user Scanner sc = new Scanner(System.in); // Declaring variables for five subjects double subject1, subject2, subject3, subject4, subject5; // Taking marks input for each subject System.out.print("Enter marks of Subject 1: "); subject1 = sc.nextDouble(); System.out.print("Enter marks of Subject 2: "); subject2 = sc.nextDouble(); System.out.print("Enter marks of Subject 3: "); subject3 = sc.nextDo...