User Profile

Collapse

Profile Sidebar

Collapse
hussainmujtaba
hussainmujtaba
Last Activity: Oct 23 '20, 09:55 AM
Joined: Apr 15 '20
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • I get your question , the problem of computing factorial has a highly repetitive structure. You can use dynamic programming to solve your problem. The conditions for implementing dynamic programming are
    • Overlapping sub-problems
    • optimal substructure


    Here is a code which may help you to understand what I am trying to say
    Code:
    def DPfact(N):
        arr={}
        if N in arr:
            return arr[N]
        elif N
    ...
    See more | Go to post
    Last edited by Rabbit; Sep 1 '20, 03:19 PM.

    Leave a comment:


  • You need to convert the inputs to int.Like this
    Code:
    x=int(input('Enter the number'))
    Here is python tutorial for beginners to know more
    See more | Go to post
    Last edited by Rabbit; Sep 1 '20, 03:45 PM.

    Leave a comment:


  • Usually when it does not wrok, it usually means that you don't have nan values in data frame .Instead you have empty strings.Just remove them.Check out these data preprocessing steps to know more.
    See more | Go to post
    Last edited by Rabbit; Sep 1 '20, 03:45 PM.

    Leave a comment:


  • You can use dump function of pickle in this way.First dump this dictionary in a pickle file.
    Code:
    import pickle
    
    a = {'HR':'Human Resource','FIN':'Finance','LG':'Legal'}
    
    with open('filename.pickle', 'wb') as handle:
        pickle.dump(a, handle, protocol=pickle.HIGHEST_PROTOCOL)
    
    #Now you will have this file, take this to your PC , save it in same #folder as Jupiter notebook you are working in
    ...
    See more | Go to post
    Last edited by Rabbit; Sep 1 '20, 03:44 PM.

    Leave a comment:


  • hussainmujtaba
    replied to what does private cloud mean?
    These clouds are specifically designed for single organization usage. This Cloud Deployment model may be physically located at the company’s on site datacenter or can be managed by a third party provider.I have picked up my answer from this blog , surely take a look if you want to know more.
    See more | Go to post
    Last edited by Rabbit; Sep 1 '20, 03:44 PM.

    Leave a comment:


  • You can use Exception handling (using try and except) to handle a divide by zero error. The concept of exception handling is similar in all languages.You can go through the java exception handling and python exception handling articles to check for yourself.
    See more | Go to post
    Last edited by Rabbit; Sep 1 '20, 03:43 PM.

    Leave a comment:


  • This will solve your problem.you cant remove the last print statement,just change the indentation
    Code:
    print("Name".center(12," "),"Age".center(12," "),"Years".center(12," "),"Salary".center(12, " "))
    #employee=[["hello","23","3","sal"],["hello","23","3","sal"]]
    for emp in
    ...
    See more | Go to post

    Leave a comment:


  • Here is a oneliner code that you can use
    Code:
    print("Welcome {}, have a nice day!! ".format(input()))
    This way you don't need to save the name anywhere.
    In case you want to save the name , use this code
    Code:
    name=input()
    print("Welcome {}, have a nice day!! ".format(name))
    See more | Go to post

    Leave a comment:


  • import locale
    >>> locale.setlocal e(locale.LC_ALL , 'en_US')
    'en_US'
    >>> locale.format(" %d", 3755125, grouping=True)
    '3,755,125'
    See more | Go to post

    Leave a comment:


  • hussainmujtaba
    replied to Launch Python program on PC
    On command prompt and go to the directory where python file is stored and type and enter
    Code:
    python "name of python file".py
    See more | Go to post

    Leave a comment:


  • hussainmujtaba
    replied to Bound method error
    Code:
    class student:
        def getStudent(self):
            self.name = input("Name: ")
            self.Roll = int(input("Roll: "))
     
    class test(student):
     
        def getMarks(self):
            print("Enter the marks of the respective subjects")
            self.literature = int(input("Literature: "))
            self.math = int(input("Math: "))
    ...
    See more | Go to post
    Last edited by Rabbit; Sep 1 '20, 03:42 PM.

    Leave a comment:


  • hussainmujtaba
    replied to Install pip command in Mint
    Before you start to install PIP on Linux Mint 19. You must have a non-root user account on your server with sudo privileges.
    To install pip run the following code
    Code:
    sudo apt install python3-pip
    to confirm its installation run this code
    Code:
    pip3 --version
    The output should be something like this
    pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
    See more | Go to post

    Leave a comment:


  • hussainmujtaba
    replied to Best tips to start out
    Python for beginner

    Python is a relatively easy language to learn but beginners may get stuck as they don't know from where to start. The best way to get started is to go through some tutorials that layout the different topics to be learned and then you can go watch tutorials on youtube.
    See more | Go to post
    Last edited by Rabbit; Sep 1 '20, 03:42 PM.

    Leave a comment:

No activity results to display
Show More
Working...