Python (Intermediate), HTML (Intermediate), CSS (Intermediate), SQL (Beginner), Bash (Beginner), JavaScript (Beginner).
You input the number of subjects for which you want to calculate average percentage, then input subject name, obtained marks and total marks for each subject. The output is the average percentage of all subjects.
You enter a price and based on a few predefined rules and you get a discount on your price.
This program showcases the binary search algorithm using python. The binary search algorithm uses the divide and conquer algorithm for searching an element. It splits the array into two halves, and based on the target element and middle element of the array, it decides which half of the number will be present and repeats until the target element is not found
This program calculates your BMI. It uses custom functions, conditionals and number system in python.
This program creates a contact book and saves it in a python dictionary for later use. The user inputs the details. You can then search for specific users in this program. If nothing is found in the search, then the program returns "not found".
This program uses the "random" module in python to select a random number from a domain, and then the user guesses that number, receiving hints on the way.
This pong game is created using the "turtle" module in python. It uses coordinates to function. The code is attached below.
# Pong Game by Paarth Pandey
# Part 1 : Getting Started
import turtle
wn = turtle.Screen()
wn.title("Pong Game by Paarth Pandey")
wn.bgcolor("black")
wn.setup(width = 800, height = 600)
wn.tracer(0)
# Score
score_a = 0
score_b = 0
# Paddle A
paddle_a = turtle.Turtle()
paddle_a.speed(0)
paddle_a.shape('square')
paddle_a.color('white')
paddle_a.penup()
paddle_a.goto(-350, 0)
paddle_a.shapesize(5, 1)
# Paddle B
paddle_b = turtle.Turtle()
paddle_b.speed(0)
paddle_b.shape('square')
paddle_b.color('white')
paddle_b.penup()
paddle_b.goto(350, 0)
paddle_b.shapesize(5, 1)
# Ball
ball = turtle.Turtle()
ball.speed(0)
ball.shape('circle')
ball.color('white')
ball.penup()
ball.goto(0, 0)
ball.dx = 0.1
ball.dy = 0.1
# Pen
pen = turtle.Turtle()
pen.speed(0)
pen.color("white")
pen.penup()
pen.hideturtle()
pen.goto(0, 260)
pen.write("Player A: 0 Player B: 0", align="center", font=("Courier", 24, "bold"))
# Functions
def paddle_a_up():
y = paddle_a.ycor()
y += 20
paddle_a.sety(y)
def paddle_a_down():
y = paddle_a.ycor()
y -= 20
paddle_a.sety(y)
def paddle_b_up():
y = paddle_b.ycor()
y += 20
paddle_b.sety(y)
def paddle_b_down():
y = paddle_b.ycor()
y -= 20
paddle_b.sety(y)
# Keyboard binding
wn.listen()
wn.onkeypress(paddle_a_up, "w")
wn.onkeypress(paddle_a_down, "s")
wn.onkeypress(paddle_b_up, "Up")
wn.onkeypress(paddle_b_down, "Down")
# Moving the ball
# Main Game Loop
while True:
wn.update()
# Move the ball
ball.setx(ball.xcor() + ball.dx)
ball.sety(ball.ycor() + ball.dy)
# Border checking
if ball.ycor() > 290:
ball.sety(290)
ball.dy *= -1
if ball.ycor() < -290:
ball.sety(-290)
ball.dy *= -1
if ball.xcor() > 390:
ball.goto(0, 0)
ball.dx *= -1
score_a += 1
pen.clear()
pen.write("Player A: {} Player B: {}".format(score_a, score_b), align="center", font=("Courier", 24, "bold"))
if ball.xcor() < -390:
ball.goto(0, 0)
ball.dx *= -1
score_b += 1
pen.clear()
pen.write("Player A: {} Player B: {}".format(score_a, score_b), align="center", font=("Courier", 24, "bold"))
# Paddle and ball bouncing
if (ball.xcor() > 340 and ball.xcor() < 350) and (ball.ycor() < paddle_b.ycor() + 50 and ball.ycor() > paddle_b.ycor() - 50):
ball.dx *= -1
if (ball.xcor() < -340 and ball.xcor() > -350) and (ball.ycor() < paddle_a.ycor() + 50 and ball.ycor() > paddle_a.ycor() - 50):
ball.dx *= -1
This project was created in the freeCodeCamp "Responsive Web Design" certification. The Camper Cafe menu project showcases an HTML design featuring a variety of coffee and dessert options. The menu includes prices for five coffee flavors (French Vanilla, Caramel Macchiato, Pumpkin Spice, Hazelnut, Mocha) and four desserts (Donut, Cherry Pie, Cheesecake, Cinnamon Roll). It also provides a link to the cafe's website and address.