1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Is here anyone that can help with few advice about python language?

Discussion in 'Black Hat SEO Tools' started by Florin94, Jun 19, 2017.

  1. Florin94

    Florin94 Junior Member

    Joined:
    Sep 29, 2016
    Messages:
    136
    Likes Received:
    8
    Hi .... I start to learn python . I am now a noob in this language but I have a book " How to think like a computer scientist" and I try to learn from it but somtimes I get complety in bugs like mising some points even if I just copy code from this bug give me few errors and whant to ask if is someone here know basic about python and can help me in this process because sometimes I vreally dont know what is wrong with my code. Can someone give a skype /whatsapp or other contact way and can help me with that? Im vreally whant to learn . Thank
     
  2. almanula

    almanula Registered Member

    Joined:
    Jun 5, 2016
    Messages:
    83
    Likes Received:
    18
    Gender:
    Male
    Search on Google for code academy its an online tutorial that is really good for a beginner
     
  3. GoDesain

    GoDesain Regular Member

    Joined:
    Feb 26, 2011
    Messages:
    480
    Likes Received:
    197
    why not show error what you got in this tread ?
     
    • Thanks Thanks x 1
  4. Florin94

    Florin94 Junior Member

    Joined:
    Sep 29, 2016
    Messages:
    136
    Likes Received:
    8
    Hi .... I whant to ask I actually create my first newbie program look like that:

    def cat(x,y):
    ... if x>y: print x
    ... elif x<y: print y
    ... else: print "equal"

    Now I whant to create this program to run input..... So program ask user for "x" and "y".
    Problem is I need to use comand input() and I dont know how to make run properlly because if I put input at top program the input comand run instantly and give error..... How should look this script in order to requires x and y from operator? Thank
     
  5. knaitas

    knaitas Junior Member

    Joined:
    Jul 26, 2016
    Messages:
    154
    Likes Received:
    124
    Gender:
    Male
    Home Page:
    Probably you are reading a book that uses python 2 and you are using python 3. in Python 3 input() is raw_input()
     
    • Thanks Thanks x 2
  6. I know SEO

    I know SEO Marketplace Mod Moderator

    Joined:
    Nov 29, 2012
    Messages:
    16,534
    Likes Received:
    6,190
    I can't help too much, I'm still a python noob but have a fair bit of knowledge in PHP and VB.

    This video helps me a lot


    I still refer to it a fair bit...
     
    • Thanks Thanks x 1
  7. itsdjango

    itsdjango Regular Member

    Joined:
    Jun 16, 2013
    Messages:
    350
    Likes Received:
    62
    Occupation:
    Engineer.
    Location:
    outside your window
    This will do (Python 2.7)

    Code:
    x = input("Enter x: ")
    y = input("Enter y: ")
    
    def cat(x,y):
        if x>y: print x
        elif x<y: print y
        else: print "equal"
    
    cat(x,y)
    You need to save this as a .py file (ex. check_number.py) and run it using(without qoutes) "python check_number.py"
     
    • Thanks Thanks x 1
  8. Florin94

    Florin94 Junior Member

    Joined:
    Sep 29, 2016
    Messages:
    136
    Likes Received:
    8
    Huge thank. Now is vreally work. I was not think about puting the x before input.... I was originally think about write input() and then x= and y =. Thank a lot
     
  9. itsdjango

    itsdjango Regular Member

    Joined:
    Jun 16, 2013
    Messages:
    350
    Likes Received:
    62
    Occupation:
    Engineer.
    Location:
    outside your window
    Glad to help.
     
  10. Florin94

    Florin94 Junior Member

    Joined:
    Sep 29, 2016
    Messages:
    136
    Likes Received:
    8
    Another question that I have is can anyone explain the diferent betwen print and return? Because do same thing in a function.... Thank.
     
  11. Beto

    Beto Newbie

    Joined:
    Dec 1, 2016
    Messages:
    36
    Likes Received:
    22
    Gender:
    Male
    Print will show what you want on the screen, and return will return a value that can be used by the program, but dont show on the screen for the user
     
  12. sadave cxx

    sadave cxx Newbie

    Joined:
    May 27, 2017
    Messages:
    25
    Likes Received:
    1
    Gender:
    Male
    I can give you some coding tips in general.Don't write to much code without executing every couple lines of code.
    as for bugs you can use eclipse to highlight the specifics of the bug
     
  13. Florin94

    Florin94 Junior Member

    Joined:
    Sep 29, 2016
    Messages:
    136
    Likes Received:
    8
    Hi... I have another question now.....
    I locking in the book and I see this code but seems ilogical for me.... Few advice will be great:
    def print_mult(n):
    i=1
    while i<=6:
    print n*i,
    i+=1
    print


    And to call this function in book say that I can use that :
    i=1
    while i<=6:
    print_mult(i)
    i+=1

    Can someone explain to me: why we need to type the last "print" from first definition at final and why in second defintion we define "i "when in fact loocking at a first code definition I will atempt to define "n" not "i" because they "i" are defined n first definition. Thank you and hope I can learn more about that.
     
  14. jamie3000

    jamie3000 Supreme Member

    Joined:
    Jun 30, 2014
    Messages:
    1,414
    Likes Received:
    655
    Occupation:
    Finance coder looking for semi-retirement
    Location:
    uk
    I agree just use stack overflow for any specific bugs. It's unbeatable.
     
  15. looser2

    looser2 Newbie

    Joined:
    Jun 7, 2017
    Messages:
    1
    Likes Received:
    0
    learn how to ask questions in stackoverflow.
    learn to read the python documentation
    learn what a error means by copy pasting the generated error in google

    No matter what level u r in your programming journey be it beginner,intermediate or advanced,you will always need these three things mentioned above