diff --git a/AerialDistanceCalc/Aerial_Distance_Calc.ipynb b/AerialDistanceCalc/Aerial_Distance_Calc.ipynb new file mode 100644 index 0000000..fb3d278 --- /dev/null +++ b/AerialDistanceCalc/Aerial_Distance_Calc.ipynb @@ -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 +} diff --git a/AerialDistanceCalc/Aerial_Distance_Calc.py b/AerialDistanceCalc/Aerial_Distance_Calc.py new file mode 100644 index 0000000..740be7e --- /dev/null +++ b/AerialDistanceCalc/Aerial_Distance_Calc.py @@ -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).") diff --git a/AerialDistanceCalc/README.md b/AerialDistanceCalc/README.md new file mode 100644 index 0000000..9d43211 --- /dev/null +++ b/AerialDistanceCalc/README.md @@ -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` + +
+ + +### *TOOLS* +[Visual Studio Code](https://code.visualstudio.com/)   [](https://www.python.org/)   [](https://jupyter.org/) + +
+
+ +[InvisiblePro](https://github.com/InvisiblePro) diff --git a/README.md b/README.md index 2f73293..4964262 100644 --- a/README.md +++ b/README.md @@ -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 @@ -12,6 +14,7 @@ - Clock - Camera -- `pip install opencv-python` - BMI Calculator +- QR Code generator -- `pip install qrcode` ### *TOOLS and LANGUAGES* [PyCharm](https://www.jetbrains.com/pycharm)   [Visual Studio Code](https://code.visualstudio.com/)   [](https://www.python.org/) diff --git a/StonePaperScissor/README.md b/StonePaperScissor/README.md new file mode 100644 index 0000000..c5008b4 --- /dev/null +++ b/StonePaperScissor/README.md @@ -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 + +
+ +[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) diff --git a/StonePaperScissor/SPS.py b/StonePaperScissor/SPS.py new file mode 100644 index 0000000..29473fe --- /dev/null +++ b/StonePaperScissor/SPS.py @@ -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() diff --git a/StonePaperScissor/logo.py b/StonePaperScissor/logo.py new file mode 100644 index 0000000..f508ec0 --- /dev/null +++ b/StonePaperScissor/logo.py @@ -0,0 +1,8 @@ +logo = """ + ______ ______ ______ + / ___/ | __ \ / ___/ + | (__ | |__) | | (__ + \__ \ | ___/ \__ \ + ___) | _ | | _ ___) | _ + /_____/ |_| |__| |_| /_____/ |_| +""" diff --git a/StonePaperScissor/main.exe b/StonePaperScissor/main.exe new file mode 100644 index 0000000..7aa25f6 Binary files /dev/null and b/StonePaperScissor/main.exe differ diff --git a/qrcode.py b/qrcode.py new file mode 100644 index 0000000..3d1cde4 --- /dev/null +++ b/qrcode.py @@ -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") \ No newline at end of file