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

Florin94

BANNED
Joined
Sep 29, 2016
Messages
194
Reaction score
15
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
 
Search on Google for code academy its an online tutorial that is really good for a beginner
 
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
 
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...
 
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"
 
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
 
Another question that I have is can anyone explain the diferent betwen print and return? Because do same thing in a function.... Thank.
 
Another question that I have is can anyone explain the diferent betwen print and return? Because do same thing in a function.... Thank.

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
 
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
 
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.
 
I agree just use stack overflow for any specific bugs. It's unbeatable.
 
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
 
Back
Top