-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
8b09c2b
commit ea6b12a
Showing
9 changed files
with
259 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from geopy.geocoders import Nominatim, ArcGIS\n", | ||
"from geopy import distance\n", | ||
"import folium\n", | ||
"geodecoder = Nominatim(user_agent=\"python\")\n", | ||
"\n", | ||
"location1 = input(\"\\nEnter your starting location : \")\n", | ||
"location2 = input(\"Enter your Destination : \")\n", | ||
"\n", | ||
"coordinates1 = geodecoder.geocode(location1)\n", | ||
"coordinates2 = geodecoder.geocode(location2)\n", | ||
"\n", | ||
"a = ArcGIS()\n", | ||
"loca1 = a.geocode(location1)\n", | ||
"loca1lat = loca1.latitude\n", | ||
"loca1lon = loca1.longitude\n", | ||
"loca2 = a.geocode(location2)\n", | ||
"loca2lat = loca2.latitude\n", | ||
"loca2lon = loca2.longitude\n", | ||
"map = folium.Map(location=[loca1lat,loca1lon],zoom_start=4)\n", | ||
"locationcap1 = location1.capitalize()\n", | ||
"locationcap2 = location2.capitalize()\n", | ||
"\n", | ||
"startingLoc = (loca1lat, loca1lon)\n", | ||
"destination = (loca2lat, loca2lon)\n", | ||
"\n", | ||
"diststr = str(distance.distance(startingLoc,destination)).split(\".\",2)[0]\n", | ||
"\n", | ||
"\n", | ||
"print(f\"Aerial Distance between your location is {diststr} km (approx..)\")\n", | ||
"map.add_child(folium.Marker(location=[loca2lat,loca2lon],popup=locationcap2,icon=folium.Icon(color=\"red\")))\n", | ||
"map.add_child(folium.Marker(location=[loca1lat,loca1lon],popup=locationcap1,icon=folium.Icon(color=\"red\")))" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"interpreter": { | ||
"hash": "ab3298061894ea8e9f63d33ee7154e99389b529bdefd6424b2d3fed3fb422773" | ||
}, | ||
"kernelspec": { | ||
"display_name": "Python 3.9.7 64-bit", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.7" | ||
}, | ||
"orig_nbformat": 4 | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
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,27 @@ | ||
from geopy.geocoders import Nominatim | ||
from geopy import distance | ||
|
||
geodecoder = Nominatim(user_agent="python") | ||
|
||
print(""" | ||
WELCOME TO AERIAL DISTANCE CALCULATOR! | ||
""") | ||
|
||
location1 = input("\tEnter your current location : ") | ||
location2 = input("\tEnter your destination : ") | ||
|
||
coordinates1 = geodecoder.geocode(location1) | ||
coordinates2 = geodecoder.geocode(location2) | ||
|
||
lat1 = coordinates1.latitude | ||
lon1 = coordinates1.longitude | ||
lat2 = coordinates2.latitude | ||
lon2 = coordinates2.longitude | ||
|
||
starting = (lat1, lon1) | ||
destination = (lat2, lon2) | ||
|
||
dist = distance.distance(starting, destination) | ||
diststr = str(dist) | ||
accdist = diststr.split(".", 2)[0] | ||
print(f"\n\tYour aerial distance would b around {accdist} km (approx).") |
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,39 @@ | ||
|
||
# Aerial_Distance_Calculator [![](https://img.shields.io/badge/Language-Python-blue?logo=python&style=for-the-badge)](https://www.python.org/) [![](https://img.shields.io/badge/Language-Jupyter-orange?logo=jupyter&style=for-the-badge)](https://jupyter.org/) | ||
|
||
### ***This program can calculate the Aerial Distance between two cities.*** | ||
|
||
|
||
### This repository include both Jupyter notebook and Python file of this program. | ||
|
||
|
||
### *JUPYTER NOTEBOOK* | ||
- Calculates distance | ||
- Displays locations over map | ||
|
||
- Modules required : | ||
|
||
> FOLIUM - `pip install folium` | ||
> GEOPY - `pip install geopy` | ||
|
||
### *PYTHON* | ||
- Calculates distance | ||
|
||
- Modules required : | ||
|
||
> FOLIUM - `pip install folium` | ||
> GEOPY - `pip install geopy` | ||
<br/> | ||
|
||
|
||
### *TOOLS* | ||
[<img alt="Visual Studio Code" src="https://cdn.icon-icons.com/icons2/2107/PNG/512/file_type_vscode_icon_130084.png" width="26px" />](https://code.visualstudio.com/) [<img src="https://cdn.iconscout.com/icon/free/png-256/python-3521655-2945099.png" width="26px" />](https://www.python.org/) [<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/38/Jupyter_logo.svg/1200px-Jupyter_logo.svg.png" width="26px"/>](https://jupyter.org/) | ||
|
||
<hr> | ||
<br> | ||
|
||
[<img src="https://img.shields.io/badge/GitHub-InvisiblePro-blue?logo=github&style=for-the-badge" alt="InvisiblePro">](https://github.com/InvisiblePro) |
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,10 @@ | ||
# Stone Paper Scissor [![](https://img.shields.io/badge/Game-Stone_Paper_Scissor-red?style=for-the-badge)](https://github.com/InvisiblePro/StonePaperScissor) | ||
|
||
## This is Stone Paper Scissor Game made with Python. | ||
|
||
Download and Run the `main.exe` file to play the game | ||
|
||
<hr> | ||
|
||
[<img src="https://img.shields.io/badge/GitHub-InvisiblePro-blue?logo=github&style=for-the-badge" alt="InvisiblePro">](https://github.com/InvisiblePro) | ||
[![](https://img.shields.io/badge/Contributer-@Idhant--6-blueviolet?logo=github&style=for-the-badge)](https://github.com/Idhant-6) |
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,94 @@ | ||
import random | ||
from logo import logo as logo | ||
|
||
print(logo) | ||
|
||
print(""" | ||
Welcome to Stone Paper Scissor! | ||
""") | ||
|
||
print(""" | ||
\n\t\t Instructions: \n\tThere will be 10 Matches to be played. | ||
""") | ||
|
||
|
||
winner = "" | ||
|
||
|
||
def Game(): | ||
userScore, compScore = 0, 0 | ||
a = 1 | ||
while a <= 10: | ||
print(""" | ||
________________________________________________________ | ||
""") | ||
print(f"\n \t\tMatch : {a}\n") | ||
user = input("Enter either 'Stone / Paper / Scissor' : ") | ||
computer = random.randint(1, 100) | ||
comp = "" | ||
|
||
if computer <= 33: | ||
comp = "Stone" | ||
if computer > 33 and computer <= 66: | ||
comp = "Paper" | ||
if computer > 66 and computer <= 100: | ||
comp = "Scissor" | ||
|
||
print(f""" | ||
Computer's choice :{comp} | ||
User's choice :{user} | ||
""") | ||
|
||
# Computer | ||
if comp == "Stone" and (user == "Scissor" or user == "scissor"): | ||
compScore = compScore+1 | ||
|
||
if comp == "Paper" and (user == "Stone" or user == "stone"): | ||
compScore = compScore+1 | ||
|
||
if comp == "Scissor" and (user == "Paper" or user == "paper"): | ||
compScore = compScore+1 | ||
|
||
# User | ||
if (user == "Stone" or user == "stone") and comp == "Scissor": | ||
userScore = userScore+1 | ||
|
||
if (user == "Paper" or user == "paper") and comp == "Stone": | ||
userScore = userScore+1 | ||
|
||
if (user == "Scissor" or user == "scissor") and comp == "Paper": | ||
userScore = userScore+1 | ||
|
||
# same | ||
|
||
if comp == "Stone" and user == "Stone" or user == "stone": | ||
userScore, compScore = userScore, compScore | ||
|
||
if comp == "Paper" and user == "Paper" or user == "paper": | ||
userScore, compScore = userScore, compScore | ||
|
||
if comp == "Scissor" and user == "Scissor": | ||
userScore, compScore == userScore, compScore | ||
|
||
print(f""" | ||
User Score : {userScore} | ||
Computer : {compScore} | ||
""") | ||
if compScore < userScore: | ||
winner = "User" | ||
print(f"\tLead : {winner}\n") | ||
|
||
if userScore < compScore: | ||
winner = "Computer" | ||
print(f"\tLead : {winner}\n") | ||
|
||
if compScore == userScore: | ||
winner = "Both" | ||
print(f"\tLead : {winner}\n") | ||
|
||
if a == 10: | ||
print(f"\n\t\nGame won by : {winner}\n") | ||
a = a+1 | ||
|
||
|
||
Game() |
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,8 @@ | ||
logo = """ | ||
______ ______ ______ | ||
/ ___/ | __ \ / ___/ | ||
| (__ | |__) | | (__ | ||
\__ \ | ___/ \__ \ | ||
___) | _ | | _ ___) | _ | ||
/_____/ |_| |__| |_| /_____/ |_| | ||
""" |
Binary file not shown.
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 @@ | ||
import qrcode,random,os | ||
|
||
qr=qrcode.QRCode(version=5,box_size=10,border=1) | ||
inp = input("Please enter data which you want to convert to QR-Code: ") | ||
qr.add_data(inp) | ||
qr.make(fit=True) | ||
img=qr.make_image(fill="black",back_color="white") | ||
r= random.randint(0,10000) | ||
img.save(f"qrc{r}.jpeg") | ||
os.startfile(f"qrc{r}.jpeg") |