Git Product home page Git Product logo

python's Introduction

Python Programming Hub

One of the best places to learn Python and Data Science

Discord GitHub forks GitHub stars GitHub repo size GitHub contributors Gitpod ready-to-code
space-1.jpg
Image Credits Wallpaper Flare

Hits

This repository gives to enough knowledge about python programming, data science and also helps you to survive in this programming world !!!

Installation tools

Below are some tools that you can download before getting started with Python, now it’s a preference, so download whichever that fits the best for you.

Name of the tools
Python download
Visual Studio Code
Jupyter Notebook
Google Colab

I use Google Colab for Python programming. It's one of the best interactive tools in the world. I like it because I can provide more documentation to the code and write some quality tutorials.

Repository Contents

This repository is divided into two parts such as Python Coding and Data Science for Beginners.

Python Coding

Follow the steps down below to get started coding in Python!!!

Pythonic Materials

Chapter 1️⃣ ⮕ Basic Concepts
Chapter 2️⃣ ⮕ Built-in Functions
Chapter 3️⃣ ⮕ Libraries
Chapter 4️⃣ ⮕ API's
Chapter 5️⃣ ⮕ Additional Materials
Chapter 6️⃣ ⮕ Exercises
Chapter 7️⃣ ⮕ Quiz
Chapter 8️⃣ ⮕ Interview Preparation

👉 Expand and Collapse the above Chapters for more details


Data Science

Follow the steps below to get started learning Data Science!!!

Data Science Materials

Data Exploration
Data Scraping from the Web

Tech is Easy

I Tanu Nanda Prabhu, always like simplifying complex things so that others can understand them more easily and better. Researching is my passion, I go through a ton of videos, articles, and tutorials and conclude starting a repository that purely contains tips and tricks for using Google Sheets. I update this repository every week with tons of information that will make your life simple. I am also seeking help from people who want to contribute to my repository. Feel free to Fork it and add updates, I will consider it.


Nbviewer

If the jupyter notebook doesn't load. Don't worry copy and paste the link to nbviewer. Because most of my jupyter notebooks are not loading.


Contributors

Currently there are 10 contributors for this repository. Feel free to contribute!

Want to know, how I did this. Refer here for the docs


Kaggle Datasets

  1. Kaggle Data Sets

HackerRank Exercises - Solved

  1. HackerRank Exercise Solved

Reddit Communities

  1. Python
  2. Learn Python
  3. Python tips
  4. Python coding

Submit your articles here

  1. Data Science from Scratch

GPT Librarian

If you have access to ChatGPT premium, there is a GPT Librarian with access to all files here here


Contact for help

Contact Info
Gmail [email protected]
Facebook Tanu N Prabhu
Instagram tanunprabhu
Linkedin Tanu Nanda Prabhu

Reviews

Below given are some of the reviews about this Python GitHub Repository:

‪Elin Uppström - Senior Lecturer at Uppsala University, Sweden.
I found your excellent exercises at your GitHub wile preparing undergraduate course in data analysis. I want to use it in my course.

‪Cole Striler - Data Scientist, Founder of Datafied
I came across your GitHub and love your Jupyter Notebooks, especially the one on "Predicting PewDiePie's daily subscribers". I think you do a great job at explaining your work which is something others can learn.

Laurence Watson - Co-Founder & CEO, Treebeard
You have a lot of great Jupyter notebook content on GitHub.

Poonam Gupta - Math & AP Computer Science Instructor, Brunswick School
Thank you so much for posting such helpful posts on GitHub.Many, many thanks for all you do to spread the knowledge.

Do you like the Repository, Please drop in your precious reviews by shooting an e-mail.


Feedback

Any Feedback or Suggestions- Please Click Here


Version

Version 14 - Last Updated on Jan 07, 2024 - 7:46 PM

Open Source Maintened by - Tanu Nanda Prabhu made-with-Markdown

python's People

Contributors

abhineet0011 avatar decron avatar gaddamms avatar kennethluczko avatar mohd-mehraj avatar prathmeshrjoshi avatar proankush avatar rishi-saw avatar roger-cmd avatar shubhamtalekar avatar subhasmitasw avatar syed-sherjeel avatar tanu-n-prabhu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python's Issues

Hangman Gave in Python not working, and I can not seem to find a solution

This is the code that I wrote
` import random
import time

Initial Steps to invite in the game

print ("\n Welcome to THE GAME \n")
name=input("Enter your name:")
print ("Hello " +name+ " May Luck be ever in your favor")
time.sleep(2)
print ("The game is about to start!\n Let's play Hangman!")
time.sleep(3)

def main():
global count
global word
global already_guessed
global length
global play_game
words_to_guess=["January","border","image","film","kids","lungs","plants","damage"]

word=random.choice(words_to_guess)
length=len(word)
count=0
display='_,'* length
already_guessed=[]
play_game=""

A loop to re-execute the game when the first round ends:

def play_loop():
global play_game
play_game=input("Do you want to play again? y=yes, n=no \n")
while play_game not in ["y","n","Y","N"]:
play_game=input("Do you want to play again? y=yes, n=no \n")
if play_game=="y":
main()
elif play_game=="n":
print("HAHAH LOOSER. RUN BACK TO YOUR MOMY")
exit()

Initializing all the condition required for the game:

def hangman():
global count
global display
global word
global already_guessed
global play_game
limit = 6
guess = input("This is the Hangman Word: " + display + " Enter your guess: \n")
guess = guess.strip()
if len(guess.strip()) == 0 or len(guess.strip()) >= 2 or guess <= "9":
print("Invalid input stupid, try a letter looser\n")
hangman()

elif guess in word:
    already_guessed.extend([guess])
    index=word.find(guess)
    word=word[:index]+"_,"+word[index+1:]
    display=display[:index]+guess+display[index+1:]
    print(display+"\n")

elif guess in already_guessed:
    print("Try another letter idiot.\n")
else:
    count +=1

    if count==1:
        time.sleep(1)
        print("|\n"
              "|\n"
              "|\n"
              "|\n"
             "_|_\n")
        print("Wrong guess."+str(limit-count)+"guesses remaining\n")
    
    elif count==2:
        time.sleep(1)
        print("________\n"
             "|\n"
             "|\n"
             "|\n"
             "|\n"
            "_|_\n")
        print("Wrong guess."+str(limit-count)+"guesses remaining\n")

    elif count==3:
        time.sleep(1)
        print("________\n"
             "|        |\n"
             "|        |\n"
             "|\n"
             "|\n"
            "_|_\n")
        print("Wrong guess."+str(limit-count)+"guesses remaining\n")
    
    elif count==4:
        time.sleep(1)
        print("________\n"
             "|        |\n"
             "|        |\n"
             "|        O\n"
             "|\n"
            "_|_\n")
        print("Wrong guess."+str(limit-count)+"guesses remaining\n")
    
    elif count==5:
        time.sleep(1)
        print("________\n"
             "|        |\n"
             "|        |\n"
             "|        O\n"
             "|       /|\\n"
             "|\n"
            "_|_\n")
        print("Wrong guess."+str(limit-count)+"guesses remaining\n")

    elif count==6:
        time.sleep(1)
        print("________\n"
             "|        |\n"
             "|        |\n"
             "|        O\n"
             "|       /|\\n"
             "|       / \\n"
            "_|_\n")
        print("Wrong guess.You are DEAD\n")
        print("The word was:", already_guessed.word)
        play_loop()

if word=='_' * length:
    print("Congrats dipsheet. You have guessed it corectly")
    play_loop()
    
elif count != limit:
    hangman()

main()

hangman() `
When I try to run it in Jupiter notebook, it works at first, asks you to type in your name, and after that comes back with the following error

TypeError Traceback (most recent call last)
in
140
141
--> 142 hangman()

in hangman()
47 global play_game
48 limit = 6
---> 49 guess = input("This is the Hangman Word: " + display + " Enter your guess: \n")
50 guess = guess.strip()
51 if len(guess.strip()) == 0 or len(guess.strip()) >= 2 or guess <= "9":

TypeError: can only concatenate str (not "function") to str

(please help) having problem in my code

Description of the Bug

1.Hi Developers im new to coding. i tried to make this video uploading app to my firebase storage but im not that good at coding so im stuck at this problem. when upload button is pressed the filechooser is opened and if i select a file it gets uploaded to the firebase But if i cancel and close the filechooser it gives an error.
2. i am unaware if this file chooser works on android or nor...if it does not please help me with this code too. im stuck on this since 6 January ,thats how poor i am.

Code

from kivy.app import App
from kivy.lang import Builder

kv = '''
<MainScreen>:
    name: 'mainscreen'
    MDLabel:
        id:username_info
        text:'Hello Main'
        font_style:'H1'
        halign:'center'

    MDFloatLayout:
        id:floate
        Video:
            id:vid

        MDToolbar:
            title: 'Bottom navigation'
            md_bg_color: .2, .2, .2, 1
            specific_text_color: 1, 1, 1, 1
        MDBottomNavigation:
            panel_color: 1,1,1,1
            MDBottomNavigationItem:
                name: 'screen 1'
                text: 'Home'
                icon: 'home-outline'
                MDRaisedButton:
                    id:upload
                    text:'Upload'
                    pos_hint:{'center_x':.5, 'center_y':.4}
                    on_release:
                        app.file_chooser()
                        upload.disabled=False
'''


class goodApp(MDApp):

    def build(self):
        self.strng = Builder.load_string(help_str)
        self.url  = "link.json"
        return self.strng

    def file_chooser(self):
        filechooser.open_file(on_selection=self.selected)        
    def selected(self,selection):
        config={
              'Api keys of firebase'
        }

        firebase=pyrebase.initialize_app(config)
        storage=firebase.storage()            
        Directory=selection[0]
        Name=re.findall('[ \w-]+\..*',Directory)
        loginEmail = self.strng.get_screen('loginscreen').ids.login_email.text
        storage.child(str(f"{loginEmail}")).child(str(f"{Name}")).put(str(f"{Name[0]}"))

        if selection==True:
            self.root.ids.vid.source=firebase
            self.strng.get_screen('mainscreen').ids.upload.disabled=True
            self.strng.get_screen('mainscreen').manager.current ='uploadscreen'
            self.strng.get_screen('mainscreen').manager.transition.direction='left'            

        if selection==False:
            self.strng.get_screen('mainscreen').ids.upload.disabled=False



if __name__ == '__main__':
    goodApp().run()

Logs

[INFO ] [Logger ] Record log in C:\Users\Dheeraj.kivy\logs\kivy_22-01-19_1.txt
[INFO ] [deps ] Successfully imported "kivy_deps.angle" 0.3.0
[INFO ] [deps ] Successfully imported "kivy_deps.glew" 0.3.0
[INFO ] [deps ] Successfully imported "kivy_deps.sdl2" 0.3.1
[INFO ] [Kivy ] v2.0.0
[INFO ] [Kivy ] Installed at "C:\Users\Dheeraj\AppData\Roaming\Python\Python38\site-packages\kivy_init_.py"
[INFO ] [Python ] v3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]
[INFO ] [Python ] Interpreter at "C:\Users\Dheeraj\AppData\Local\Programs\Python\Python38\pythonw.exe"
[INFO ] [Factory ] 186 symbols loaded
[INFO ] [KivyMD ] 0.104.2, git-bc7d1f5, 2021-06-06 (installed at "C:\Users\Dheeraj\AppData\Local\Programs\Python\Python38\lib\site-packages\kivymd_init_.py")
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO ] [Text ] Provider: sdl2
[INFO ] [Window ] Provider: sdl2
[INFO ] [GL ] Using the "OpenGL" graphics system
[INFO ] [GL ] GLEW initialization succeeded
[INFO ] [GL ] Backend used
[INFO ] [GL ] OpenGL version <b'2.1 Mesa 10.0.2 (git-675cd84)'>
[INFO ] [GL ] OpenGL vendor <b'VMware, Inc.'>
[INFO ] [GL ] OpenGL renderer <b'Gallium 0.4 on llvmpipe (LLVM 3.4, 128 bits)'>
[INFO ] [GL ] OpenGL parsed version: 2, 1
[INFO ] [GL ] Shading version <b'1.30'>
[INFO ] [GL ] Texture max size <8192>
[INFO ] [GL ] Texture max units <16>
[INFO ] [Window ] auto add sdl2 input provider
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[INFO ] [KivMob ] init called.
[WARNING] [KivMob ] Ads will not be shown.
[INFO ] [GL ] NPOT texture support is available
[INFO ] [Video ] Provider: null(['video_ffmpeg', 'video_ffpyplayer'] ignored)
[INFO ] [Base ] Start application main loop
Traceback (most recent call last):
File "C:\Users\Dheeraj\AppData\Roaming\Python\Python38\site-packages\plyer\platforms\win\filechooser.py", line 102, in run
self.fname, _, _ = win32gui.GetOpenFileNameW(**args)
pywintypes.error: (0, 'GetOpenFileNameW', 'No error message is available')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Dheeraj\AppData\Roaming\Python\Python38\site-packages\plyer\platforms\win\filechooser.py", line 108, in run
self._handle_selection(self.selection)
File "C:\Users\Dheeraj\Desktop\kivy codes\priyanshu doraming\Magenta.py", line 949, in selected
Directory=selection[0]
IndexError: list index out of range
[INFO ] [Base ] Leaving application in progress...

Screenshots

Add images to explain us this bug. Paste urls here.

Remove this section if no images here

Versions

  • OS: win 7 pro
  • Python: 3.7
  • Kivy: latest
  • KivyMD: latest (update everyweek)

python nested if issue

I am a beginner who is still learning how to use python syntax.I tried to write codes using if conditions as exercising but I had an issue.
the idea of the code is to write a program that allows the user to enter his country and the course he wants to apply for then the program will give him a discount regarding this information.

issue: the issue is every time I write ksa as the input it gives me a discount for Canada and I don't know why.

code ==>

name=input("enter your name\n")
country=input("enter your country\n").strip()
course=input("enter your course\n")

studentcheck=input("Are you student ?\n")
prcice=100
if (country=="Canada" or "canada") and (course=="python"):
if studentcheck=="yes":
print(f"Hello {name} from {country}")
print(f"you course will be 10$")
elif studentcheck=="no":
print(f"Hello {name} from {country}")
print(f"you course will be 20$ ")
else :
print("you don't have discount from USA")
elif (country=="ksa") and (course=="python"):

if studentcheck=="yes":
    print(f"Hello {name} from {country}")
    print(f"you course will be 30$")
elif studentcheck=="no":
    print(f"Hello {name} from {country}")
    print(f"you course will be 40$ ")
else :
    print("you don't have discount from KSA")

else:
print("No discounts")

Python wikipedia module issue

Discussed in #21

Originally posted by DickieTheProgrammer September 1, 2021
In your example of "bass", I get an entirely different disambiguation list than what's shown here. It appears to search for "band." Searching for "band" appears to search for "can".

>>> w.page('bass')
C:\Users\payne\AppData\Local\Programs\Python\Python39\lib\site-packages\wikipedia\wikipedia.py:389: GuessedAtParserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("html.parser"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.

The code that caused this warning is on line 389 of the file C:\Users\payne\AppData\Local\Programs\Python\Python39\lib\site-packages\wikipedia\wikipedia.py. To get rid of this warning, pass the additional argument 'features="html.parser"' to the BeautifulSoup constructor.

  lis = BeautifulSoup(html).find_all('li')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\payne\AppData\Local\Programs\Python\Python39\lib\site-packages\wikipedia\wikipedia.py", line 276, in page
    return WikipediaPage(title, redirect=redirect, preload=preload)
  File "C:\Users\payne\AppData\Local\Programs\Python\Python39\lib\site-packages\wikipedia\wikipedia.py", line 299, in __init__
    self.__load(redirect=redirect, preload=preload)
  File "C:\Users\payne\AppData\Local\Programs\Python\Python39\lib\site-packages\wikipedia\wikipedia.py", line 367, in __load
    self.__init__(redirects['to'], redirect=redirect, preload=preload)
  File "C:\Users\payne\AppData\Local\Programs\Python\Python39\lib\site-packages\wikipedia\wikipedia.py", line 299, in __init__
    self.__load(redirect=redirect, preload=preload)
  File "C:\Users\payne\AppData\Local\Programs\Python\Python39\lib\site-packages\wikipedia\wikipedia.py", line 393, in __load
    raise DisambiguationError(getattr(self, 'title', page['title']), may_refer_to)
wikipedia.exceptions.DisambiguationError: "Band" may refer to:
Bánd
Band, Iran
Band, Mureș
Band-e Majid Khan
Band (surname)
...

and 

>>> w.page('band')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\payne\AppData\Local\Programs\Python\Python39\lib\site-packages\wikipedia\wikipedia.py", line 276, in page
    return WikipediaPage(title, redirect=redirect, preload=preload)
  File "C:\Users\payne\AppData\Local\Programs\Python\Python39\lib\site-packages\wikipedia\wikipedia.py", line 299, in __init__
    self.__load(redirect=redirect, preload=preload)
  File "C:\Users\payne\AppData\Local\Programs\Python\Python39\lib\site-packages\wikipedia\wikipedia.py", line 393, in __load
    raise DisambiguationError(getattr(self, 'title', page['title']), may_refer_to)
wikipedia.exceptions.DisambiguationError: "can" may refer to:
Aluminum can
Drink can
Oil can
...</div>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.