Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
InvisiblePro authored Aug 6, 2023
1 parent 8b09c2b commit ea6b12a
Show file tree
Hide file tree
Showing 9 changed files with 259 additions and 0 deletions.
68 changes: 68 additions & 0 deletions AerialDistanceCalc/Aerial_Distance_Calc.ipynb
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
}
27 changes: 27 additions & 0 deletions AerialDistanceCalc/Aerial_Distance_Calc.py
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).")
39 changes: 39 additions & 0 deletions AerialDistanceCalc/README.md
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/) &nbsp; [<img src="https://cdn.iconscout.com/icon/free/png-256/python-3521655-2945099.png" width="26px" />](https://www.python.org/) &nbsp; [<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)
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
### _This Repository Contains some of the basic Python Programs For Beginners._


- Aerial Distance Calculator -- `pip install folium geopy`
- Stone Paper Scissor Game
- 2 Player Pong game -- `pip install pygame`
- Fibonacci Series
- Leap Year Finder
Expand All @@ -12,6 +14,7 @@
- Clock
- Camera -- `pip install opencv-python`
- BMI Calculator
- QR Code generator -- `pip install qrcode`

### *TOOLS and LANGUAGES*
[<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/1/1d/PyCharm_Icon.svg/1024px-PyCharm_Icon.svg.png" alt="PyCharm" width="40px">](https://www.jetbrains.com/pycharm) &nbsp; [<img alt="Visual Studio Code" src="https://cdn.icon-icons.com/icons2/2107/PNG/512/file_type_vscode_icon_130084.png" width="30px" />](https://code.visualstudio.com/) &nbsp; [<img src="https://cdn.iconscout.com/icon/free/png-256/python-3521655-2945099.png" width="30px" />](https://www.python.org/)
Expand Down
10 changes: 10 additions & 0 deletions StonePaperScissor/README.md
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)
94 changes: 94 additions & 0 deletions StonePaperScissor/SPS.py
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()
8 changes: 8 additions & 0 deletions StonePaperScissor/logo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
logo = """
______ ______ ______
/ ___/ | __ \ / ___/
| (__ | |__) | | (__
\__ \ | ___/ \__ \
___) | _ | | _ ___) | _
/_____/ |_| |__| |_| /_____/ |_|
"""
Binary file added StonePaperScissor/main.exe
Binary file not shown.
10 changes: 10 additions & 0 deletions qrcode.py
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")

0 comments on commit ea6b12a

Please sign in to comment.