Skip to main content

The Ultimate Guide to Installing Git: A Comprehensive Walkthrough for Windows and macOS

The Ultimate Guide to Installing Git: A  Comprehensive Walkthrough for  Windows and  macOS Introduction: Why Every Developer Needs Git in 2025 For anyone in software development , whether you're a student, a freelancer, or part of a large engineering team, mastering  Git  is non-negotiable. This powerful, free, and open-source distributed version control system (DVCS) is the engine that drives modern collaboration and code management. In 2025, Git remains the industry standard, allowing developers to: Track and manage project changes with a detailed history. Collaborate seamlessly with other team members without overwriting work. Work on new features independently through branching . Safely experiment and revert to stable versions at any point. Pre Installation Checklists Before you begin, a quick check can prevent potential issues. Check for existing installation:  Open your terminal or command prompt and type  git --version . If you see a version n...

Python Conditional Statement Using for Average & Percentage of User Input Marks with Pass & Fail Check

 Creating a Python program that calculates the average and percentage of user input marks, along with implementing a pass/fail check using if-else statements.

{Formula to calculate the Average of Marks is (Marks of Subject 1 + Marks of Subject 2+Marks of Subject 3 + Marks of Subject 4 + Marks of Subject 5)/Total No. of Subjects

Formula to Calculate the Percentage of Marks is (Total No. Subject Marks / Total Marks of Subjects) * 100 (Multiplied by 100)}

Input is Shown Below :


Code :

#Average & Percenatage of User Input Marks with Pass & Fail Check
#Code by IAH (Infinity Aggarwal Harshul)

a = int(input("Enter Subject 1 Marks : "))  #input function will input the user value in it
b = int(input("Enter Subject 2 Marks : "))
c = int(input("Enter Subject 3 Marks : "))
d = int(input("Enter Subject 4 Marks : "))
e = int(input("Enter Subject 5 Marks : "))
f = (a+b+c+d+e)                            #additon operator will add all the numbers
s = f/5                                     #division operator will divide the sum with 5
t = ((f/500)*100)                           # here BODMASS Rule will be followed and value will be stored in a vairable
print("Average of Marks is : ",(s))         # now print will prints the output value os s variable
print("Percentage is : " ,(t),"%")
if (t>=50) :                                #If condition will execute statement that if marks are above 50%
    print ("pass")                           # then print pass
else :                                       # Else condition will execute if marks are below 50%
    print ("fail")                           #then fail will be printed in the output

    #The output will be final average and percentage of marks will pass & fail check too

Output is Shown Below :


Explanation:

  1. Five variables a, b, c , d and e are taking user input values of each subject marks
  2. Now all values are stored in these 5 variables
  3. Now lets take average of all these 5 variables (means like addition of all 5 variables) and stored it in new variable f (And, we can take directly the all formula in single variable but according to BODMASS Rule, the python follows that so then answer might vary that's why all variables are taken separately)
  4. Now the lets assign a new variable t which will store the average of 5 variables i.e. (f divided by total marks of all subjects which will be simply (5*100) = 500 and then simply, multiply it by 100 to get point value.
  5. Now we will print the values stored inside the s variable and with a line of average of marks is
  6. Now we will print the values stored inside the t variable and with a line of percentage is
  7. After this we will execute the if conditional statement that if total percentage of all subjects is greater than or equal to 50 then print the student is pass
  8. Else then print directly that student is fail
  9. The output will show the final results after taken user input values that whether the student is pass or fail that will get decided by conditional statements.

Comments

Popular posts from this blog

The Power of Two: The Benefits and Pitfalls of Running Windows and Linux on One Machine

The Power of Two: The Benefits and Pitfalls of Running Windows and Linux on One Machine In the world of computing, the choice of operating system (OS) is a fundamental decision that shapes your workflow. While most users stick to a single OS, many developers, IT professionals, and enthusiasts are drawn to the idea of running both Windows and Linux on a single machine. This " dual-booting " setup offers a unique blend of power and flexibility, combining the vast software ecosystem of Windows with the developer-friendly, open-source environment of Linux. But is it the right choice for you?  This comprehensive guide will explore the compelling benefits of this hybrid approach, its potential side effects, and provide a clear, step-by-step process for safely uninstalling Linux when you no longer need it. The Best of Both Worlds: Why Dual-Boot? Dual-booting is the practice of installing two separate operating systems on a single computer, with the option to choose which one to st...

The Ultimate Guide to Installing and Setting Up PostgreSQL on Windows and Mac

The Ultimate Guide to Installing and Setting Up PostgreSQL on Windows and Mac PostgreSQL is one of the world's most powerful and advanced open-source relational database systems . It is renowned for its reliability, feature richness, and high performance. If you're a developer , data analyst , or simply someone interested in working with databases, setting up PostgreSQL on your machine is a fundamental step. This comprehensive guide will walk you through the process of installing and setting up PostgreSQL on both Windows and macOS . Why Choose PostgreSQL? Before we dive into the installation, let's understand why PostgreSQL is a top choice for many professionals: Robustness: PostgreSQL is known for its data integrity and reliability, adhering strictly to SQL standards . Extensibility: It supports a wide range of data types, including JSON and XML , and can be extended with custom functions and features. Open-Source & Free: It is free to use and has a vibrant, supp...

The Ultimate Guide to Installing Git: A Comprehensive Walkthrough for Windows and macOS

The Ultimate Guide to Installing Git: A  Comprehensive Walkthrough for  Windows and  macOS Introduction: Why Every Developer Needs Git in 2025 For anyone in software development , whether you're a student, a freelancer, or part of a large engineering team, mastering  Git  is non-negotiable. This powerful, free, and open-source distributed version control system (DVCS) is the engine that drives modern collaboration and code management. In 2025, Git remains the industry standard, allowing developers to: Track and manage project changes with a detailed history. Collaborate seamlessly with other team members without overwriting work. Work on new features independently through branching . Safely experiment and revert to stable versions at any point. Pre Installation Checklists Before you begin, a quick check can prevent potential issues. Check for existing installation:  Open your terminal or command prompt and type  git --version . If you see a version n...