-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
304 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
first = input("enter first number:") | ||
operator = input("enter operator (+, -, *, /, %) : ") | ||
second = input("enter second number:") | ||
|
||
first = int(first) | ||
second = int(second) | ||
|
||
if operator == "+": | ||
print(first + second) | ||
|
||
elif operator == "-": | ||
print(first - second) | ||
|
||
elif operator == "*": | ||
print(first * second) | ||
|
||
elif operator == "/": | ||
print(first / second) | ||
|
||
elif operator == "%": | ||
print(first % second) | ||
|
||
|
||
else: | ||
print("Invalid operator") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import heapq | ||
|
||
def dijkstra(graph, start): | ||
# Initialize distances and visited set | ||
distances = {vertex: float('infinity') for vertex in graph} | ||
distances[start] = 0 | ||
visited = set() | ||
|
||
# Priority queue to store vertices with their distances | ||
priority_queue = [(0, start)] | ||
|
||
while priority_queue: | ||
current_distance, current_vertex = heapq.heappop(priority_queue) | ||
|
||
# Skip if we have already processed this vertex | ||
if current_vertex in visited: | ||
continue | ||
|
||
visited.add(current_vertex) | ||
|
||
# Explore neighbors | ||
for neighbor, weight in graph[current_vertex].items(): | ||
distance = current_distance + weight | ||
|
||
# If we find a shorter path to the neighbor, update the distance | ||
if distance < distances[neighbor]: | ||
distances[neighbor] = distance | ||
heapq.heappush(priority_queue, (distance, neighbor)) | ||
|
||
return distances | ||
|
||
# Example usage: | ||
graph = { | ||
'A': {'B': 1, 'C': 4}, | ||
'B': {'A': 1, 'C': 2, 'D': 5}, | ||
'C': {'A': 4, 'B': 2, 'D': 1}, | ||
'D': {'B': 5, 'C': 1} | ||
} | ||
|
||
start_vertex = 'A' | ||
shortest_distances = dijkstra(graph, start_vertex) | ||
|
||
for vertex, distance in shortest_distances.items(): | ||
print(f'Shortest distance from {start_vertex} to {vertex} is {distance}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
def fibonacci_with_golden_ratio(n): | ||
if n <= 0: | ||
return [] | ||
|
||
# Define the starting values for F(0) and F(1) | ||
fibonacci_sequence = [0, 1] | ||
|
||
# Calculate Fibonacci numbers using the golden ratio approximation | ||
while len(fibonacci_sequence) < n: | ||
# Calculate the next Fibonacci number using the golden ratio | ||
next_fibonacci = fibonacci_sequence[-1] + fibonacci_sequence[-2] | ||
fibonacci_sequence.append(next_fibonacci) | ||
|
||
return fibonacci_sequence | ||
|
||
n = 10 | ||
|
||
# Generate and print the Fibonacci sequence | ||
fib_sequence = fibonacci_with_golden_ratio(n) | ||
print(fib_sequence) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import tkinter as tk | ||
import time | ||
|
||
def start(): | ||
global running | ||
running = True | ||
start_button['state'] = 'disabled' | ||
stop_button['state'] = 'active' | ||
update() | ||
|
||
def stop(): | ||
global running | ||
running = False | ||
start_button['state'] = 'active' | ||
stop_button['state'] = 'disabled' | ||
|
||
def reset(): | ||
global running, elapsed_time | ||
running = False | ||
elapsed_time = 0 | ||
time_label.config(text="00:00:00") | ||
start_button['state'] = 'active' | ||
stop_button['state'] = 'disabled' | ||
|
||
def update(): | ||
if running: | ||
global elapsed_time | ||
elapsed_time += 1 | ||
hours, remainder = divmod(elapsed_time, 3600) | ||
minutes, seconds = divmod(remainder, 60) | ||
time_str = f"{hours:02d}:{minutes:02d}:{seconds:02d}" | ||
time_label.config(text=time_str) | ||
time_label.after(1000, update) | ||
|
||
running = False | ||
elapsed_time = 0 | ||
|
||
root = tk.Tk() | ||
root.title("Cool Stopwatch") | ||
|
||
time_label = tk.Label(root, text="00:00:00", font=('Helvetica', 48)) | ||
time_label.pack(padx=20, pady=20) | ||
|
||
start_button = tk.Button(root, text="Start", font=('Helvetica', 16), command=start) | ||
start_button.pack(side="left", padx=10) | ||
stop_button = tk.Button(root, text="Stop", font=('Helvetica', 16), command=stop) | ||
stop_button.pack(side="left", padx=10) | ||
reset_button = tk.Button(root, text="Reset", font=('Helvetica', 16), command=reset) | ||
reset_button.pack(side="left", padx=10) | ||
|
||
stop_button['state'] = 'disabled' | ||
|
||
root.mainloop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Ishan Dutta | ||
|
||
### Location | ||
|
||
Bangalore, India | ||
|
||
### Academics | ||
|
||
BVUCOEP | ||
|
||
### Interests | ||
|
||
- Computer Vision | ||
- Deep Learning | ||
|
||
### Profile Link | ||
|
||
[Ishan Dutta](https://github.com/ishandutta0098) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Naymul Islam | ||
|
||
### Location | ||
|
||
Chittagong, BANGLADESH | ||
|
||
### Academics | ||
|
||
- High School | ||
|
||
### Interests | ||
|
||
- Machine Learning | ||
- Hiking | ||
- Programming | ||
- Learning Enthusiast | ||
- DSA | ||
|
||
### Skills | ||
|
||
- Python | ||
- JavaScript | ||
- CSS | ||
- HTML | ||
- Statistics | ||
- Good knowledge in Programming Language | ||
|
||
|
||
### Profile Link | ||
|
||
[Abhishek Kayal](https://github.com/ai-naymul) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# TANYA KUMARI | ||
|
||
### Location | ||
|
||
⚓ Bokaro,Jharkhand, India | ||
|
||
### Academics | ||
|
||
🎒 Undergraduate in MAKAUT, West Bengal, India | ||
|
||
### Interests | ||
|
||
⚡ Javascript, Reactjs, Expressjs, Nodejs, GO, Laravel. | ||
|
||
🌱 MERN Stack and Backend Stack. | ||
|
||
🌱 Currently learning Expressjs and Nodejs. | ||
|
||
### Development | ||
|
||
🚀 Backend Web Development | ||
|
||
### Projects | ||
|
||
🚧 [ARTICLE-AI-SUMMARIZER](https://github.com/07tAnYa/Article-AI-Summarizer) This is a web-based Article Summarizer built using React and Vite. It utilizes the Rapid API to provide summaries of articles from the provided links. The project aims to simplify the process of extracting key information from lengthy articles. | ||
|
||
🚧 [METAVERSE](https://github.com/07tAnYa/mEtaVerse) A web based application to display the concept of parallel world. | ||
|
||
💼 [NIKE](https://github.com/07tAnYa/nike) A web application to display a list of the most popular shoes. | ||
|
||
### Profile Link | ||
|
||
[Tanya Kumari](https://github.com/07tAnYa) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Aditya Shukla | ||
|
||
### Location | ||
|
||
Lucknow,Uttar Pradesh,India | ||
|
||
### Academics | ||
|
||
School : City Montessori School | ||
college : SMVDU | ||
|
||
### Interests | ||
|
||
- Coding/reading books | ||
- Anime | ||
- Mobile Gaming | ||
- Web Development | ||
- After effects renders | ||
|
||
### Skills | ||
|
||
- C/C++ | ||
- Python | ||
- HTML/CSS/JS/Nodejs | ||
- Video Editing(After effects) | ||
|
||
### Profile Link | ||
|
||
[Aditya Shukla](https://github.com/adityasays) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
def calculate_bmi(weight, height): | ||
bmi = weight / (height ** 2) | ||
return bmi | ||
|
||
weight = float(input("Enter your weight in kg: ")) | ||
height = float(input("Enter your height in meters: ")) | ||
|
||
bmi = calculate_bmi(weight, height) | ||
|
||
print("Your BMI is: ", bmi) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import datetime | ||
|
||
name = input("Enter your name: ") | ||
finalName = "" | ||
for word in name.split(" "): | ||
finalName += word[0].upper() + word[1:].lower() | ||
finalName += " " | ||
finalName = finalName.rstrip(" ") | ||
now = datetime.datetime.now() | ||
|
||
print(now.strftime("%d %b 20%y %H:%M:%S")) | ||
print("Hello, " + finalName + "!") | ||
print("Have a lovely day.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# LANGUAGE: Python | ||
# ENV: Python3.11 | ||
# AUTHOR: Naymul Islam | ||
# GITHUB: https://github.com/ai-naymul | ||
|
||
def hello_world(): | ||
print('Hello, World!') | ||
|
||
hello_world() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// LANGUAGE: Javascript | ||
// ENV: Node.js | ||
// AUTHOR: Aditya Shukla | ||
// GITHUB: https://github.com/adityasays | ||
|
||
console.log('Hello, World!'); |