Skip to content

Commit ea6b12a

Browse files
authored
Update
1 parent 8b09c2b commit ea6b12a

File tree

9 files changed

+259
-0
lines changed

9 files changed

+259
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"from geopy.geocoders import Nominatim, ArcGIS\n",
10+
"from geopy import distance\n",
11+
"import folium\n",
12+
"geodecoder = Nominatim(user_agent=\"python\")\n",
13+
"\n",
14+
"location1 = input(\"\\nEnter your starting location : \")\n",
15+
"location2 = input(\"Enter your Destination : \")\n",
16+
"\n",
17+
"coordinates1 = geodecoder.geocode(location1)\n",
18+
"coordinates2 = geodecoder.geocode(location2)\n",
19+
"\n",
20+
"a = ArcGIS()\n",
21+
"loca1 = a.geocode(location1)\n",
22+
"loca1lat = loca1.latitude\n",
23+
"loca1lon = loca1.longitude\n",
24+
"loca2 = a.geocode(location2)\n",
25+
"loca2lat = loca2.latitude\n",
26+
"loca2lon = loca2.longitude\n",
27+
"map = folium.Map(location=[loca1lat,loca1lon],zoom_start=4)\n",
28+
"locationcap1 = location1.capitalize()\n",
29+
"locationcap2 = location2.capitalize()\n",
30+
"\n",
31+
"startingLoc = (loca1lat, loca1lon)\n",
32+
"destination = (loca2lat, loca2lon)\n",
33+
"\n",
34+
"diststr = str(distance.distance(startingLoc,destination)).split(\".\",2)[0]\n",
35+
"\n",
36+
"\n",
37+
"print(f\"Aerial Distance between your location is {diststr} km (approx..)\")\n",
38+
"map.add_child(folium.Marker(location=[loca2lat,loca2lon],popup=locationcap2,icon=folium.Icon(color=\"red\")))\n",
39+
"map.add_child(folium.Marker(location=[loca1lat,loca1lon],popup=locationcap1,icon=folium.Icon(color=\"red\")))"
40+
]
41+
}
42+
],
43+
"metadata": {
44+
"interpreter": {
45+
"hash": "ab3298061894ea8e9f63d33ee7154e99389b529bdefd6424b2d3fed3fb422773"
46+
},
47+
"kernelspec": {
48+
"display_name": "Python 3.9.7 64-bit",
49+
"language": "python",
50+
"name": "python3"
51+
},
52+
"language_info": {
53+
"codemirror_mode": {
54+
"name": "ipython",
55+
"version": 3
56+
},
57+
"file_extension": ".py",
58+
"mimetype": "text/x-python",
59+
"name": "python",
60+
"nbconvert_exporter": "python",
61+
"pygments_lexer": "ipython3",
62+
"version": "3.9.7"
63+
},
64+
"orig_nbformat": 4
65+
},
66+
"nbformat": 4,
67+
"nbformat_minor": 2
68+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from geopy.geocoders import Nominatim
2+
from geopy import distance
3+
4+
geodecoder = Nominatim(user_agent="python")
5+
6+
print("""
7+
WELCOME TO AERIAL DISTANCE CALCULATOR!
8+
""")
9+
10+
location1 = input("\tEnter your current location : ")
11+
location2 = input("\tEnter your destination : ")
12+
13+
coordinates1 = geodecoder.geocode(location1)
14+
coordinates2 = geodecoder.geocode(location2)
15+
16+
lat1 = coordinates1.latitude
17+
lon1 = coordinates1.longitude
18+
lat2 = coordinates2.latitude
19+
lon2 = coordinates2.longitude
20+
21+
starting = (lat1, lon1)
22+
destination = (lat2, lon2)
23+
24+
dist = distance.distance(starting, destination)
25+
diststr = str(dist)
26+
accdist = diststr.split(".", 2)[0]
27+
print(f"\n\tYour aerial distance would b around {accdist} km (approx).")

AerialDistanceCalc/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
# 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/)
3+
4+
### ***This program can calculate the Aerial Distance between two cities.***
5+
6+
7+
### This repository include both Jupyter notebook and Python file of this program.
8+
9+
10+
### *JUPYTER NOTEBOOK*
11+
- Calculates distance
12+
- Displays locations over map
13+
14+
- Modules required :
15+
16+
> FOLIUM - `pip install folium`
17+
18+
> GEOPY - `pip install geopy`
19+
20+
21+
### *PYTHON*
22+
- Calculates distance
23+
24+
- Modules required :
25+
26+
> FOLIUM - `pip install folium`
27+
28+
> GEOPY - `pip install geopy`
29+
30+
<br/>
31+
32+
33+
### *TOOLS*
34+
[<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/)
35+
36+
<hr>
37+
<br>
38+
39+
[<img src="https://img.shields.io/badge/GitHub-InvisiblePro-blue?logo=github&style=for-the-badge" alt="InvisiblePro">](https://github.com/InvisiblePro)

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
### _This Repository Contains some of the basic Python Programs For Beginners._
44

55

6+
- Aerial Distance Calculator -- `pip install folium geopy`
7+
- Stone Paper Scissor Game
68
- 2 Player Pong game -- `pip install pygame`
79
- Fibonacci Series
810
- Leap Year Finder
@@ -12,6 +14,7 @@
1214
- Clock
1315
- Camera -- `pip install opencv-python`
1416
- BMI Calculator
17+
- QR Code generator -- `pip install qrcode`
1518

1619
### *TOOLS and LANGUAGES*
1720
[<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/)

StonePaperScissor/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Stone Paper Scissor [![](https://img.shields.io/badge/Game-Stone_Paper_Scissor-red?style=for-the-badge)](https://github.com/InvisiblePro/StonePaperScissor)
2+
3+
## This is Stone Paper Scissor Game made with Python.
4+
5+
Download and Run the `main.exe` file to play the game
6+
7+
<hr>
8+
9+
[<img src="https://img.shields.io/badge/GitHub-InvisiblePro-blue?logo=github&style=for-the-badge" alt="InvisiblePro">](https://github.com/InvisiblePro)
10+
[![](https://img.shields.io/badge/Contributer-@Idhant--6-blueviolet?logo=github&style=for-the-badge)](https://github.com/Idhant-6)

StonePaperScissor/SPS.py

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
import random
2+
from logo import logo as logo
3+
4+
print(logo)
5+
6+
print("""
7+
Welcome to Stone Paper Scissor!
8+
""")
9+
10+
print("""
11+
\n\t\t Instructions: \n\tThere will be 10 Matches to be played.
12+
""")
13+
14+
15+
winner = ""
16+
17+
18+
def Game():
19+
userScore, compScore = 0, 0
20+
a = 1
21+
while a <= 10:
22+
print("""
23+
________________________________________________________
24+
""")
25+
print(f"\n \t\tMatch : {a}\n")
26+
user = input("Enter either 'Stone / Paper / Scissor' : ")
27+
computer = random.randint(1, 100)
28+
comp = ""
29+
30+
if computer <= 33:
31+
comp = "Stone"
32+
if computer > 33 and computer <= 66:
33+
comp = "Paper"
34+
if computer > 66 and computer <= 100:
35+
comp = "Scissor"
36+
37+
print(f"""
38+
Computer's choice :{comp}
39+
User's choice :{user}
40+
""")
41+
42+
# Computer
43+
if comp == "Stone" and (user == "Scissor" or user == "scissor"):
44+
compScore = compScore+1
45+
46+
if comp == "Paper" and (user == "Stone" or user == "stone"):
47+
compScore = compScore+1
48+
49+
if comp == "Scissor" and (user == "Paper" or user == "paper"):
50+
compScore = compScore+1
51+
52+
# User
53+
if (user == "Stone" or user == "stone") and comp == "Scissor":
54+
userScore = userScore+1
55+
56+
if (user == "Paper" or user == "paper") and comp == "Stone":
57+
userScore = userScore+1
58+
59+
if (user == "Scissor" or user == "scissor") and comp == "Paper":
60+
userScore = userScore+1
61+
62+
# same
63+
64+
if comp == "Stone" and user == "Stone" or user == "stone":
65+
userScore, compScore = userScore, compScore
66+
67+
if comp == "Paper" and user == "Paper" or user == "paper":
68+
userScore, compScore = userScore, compScore
69+
70+
if comp == "Scissor" and user == "Scissor":
71+
userScore, compScore == userScore, compScore
72+
73+
print(f"""
74+
User Score : {userScore}
75+
Computer : {compScore}
76+
""")
77+
if compScore < userScore:
78+
winner = "User"
79+
print(f"\tLead : {winner}\n")
80+
81+
if userScore < compScore:
82+
winner = "Computer"
83+
print(f"\tLead : {winner}\n")
84+
85+
if compScore == userScore:
86+
winner = "Both"
87+
print(f"\tLead : {winner}\n")
88+
89+
if a == 10:
90+
print(f"\n\t\nGame won by : {winner}\n")
91+
a = a+1
92+
93+
94+
Game()

StonePaperScissor/logo.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
logo = """
2+
______ ______ ______
3+
/ ___/ | __ \ / ___/
4+
| (__ | |__) | | (__
5+
\__ \ | ___/ \__ \
6+
___) | _ | | _ ___) | _
7+
/_____/ |_| |__| |_| /_____/ |_|
8+
"""

StonePaperScissor/main.exe

6.6 MB
Binary file not shown.

qrcode.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import qrcode,random,os
2+
3+
qr=qrcode.QRCode(version=5,box_size=10,border=1)
4+
inp = input("Please enter data which you want to convert to QR-Code: ")
5+
qr.add_data(inp)
6+
qr.make(fit=True)
7+
img=qr.make_image(fill="black",back_color="white")
8+
r= random.randint(0,10000)
9+
img.save(f"qrc{r}.jpeg")
10+
os.startfile(f"qrc{r}.jpeg")

0 commit comments

Comments
 (0)