Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
looking for a python-tutorial
looking for a python-tutorial
hello,
i try to learn python since a few months.
I`m not able to do that much with it:
right now i`m trying to learn def, lambdas, open,close,read, write...
( i haven`t reached the modules yet)
As i`m a bit bored of all those
if a > 7:
while i != 4:
and other things of that kind
i wanted to ask, if there`s an online tutorial
or a book (i`d prefer that)
where you might learn python according to linux?
Or should i move on the way i`m doing it now
(learning the basics by making useless calculations and lists)?
thanks for an advice
jalu
i try to learn python since a few months.
I`m not able to do that much with it:
right now i`m trying to learn def, lambdas, open,close,read, write...
( i haven`t reached the modules yet)
As i`m a bit bored of all those
if a > 7:
while i != 4:
and other things of that kind
i wanted to ask, if there`s an online tutorial
or a book (i`d prefer that)
where you might learn python according to linux?
Or should i move on the way i`m doing it now
(learning the basics by making useless calculations and lists)?
thanks for an advice
jalu
I like this one: http://diveintopython.org/
It's aimed at 'experienced programmers' but used together with Google it's quite usable also for beginners. You'll probably still have to do small silly programs to try the stuff out though
It's aimed at 'experienced programmers' but used together with Google it's quite usable also for beginners. You'll probably still have to do small silly programs to try the stuff out though
Re: looking for a python-tutorial
Tired of loops and conditional statements? Hehe use them bothjalu wrote: As i`m a bit bored of all those
if a > 7:
while i != 4:
Code: Select all
#!/usr/bin/python
# A nice library to use here
import random
# max and min values
valor_min = 1
valor_max = 10
# Generate a random number
magic_number = random.randrange(valor_min, valor_max);
# save user input
u = -1
# loop until user inputs the correct number
while u != magic_number:
# Print a friendly message :)
print "I'm a bot, guess my magic number between %i..%i. (note: use zero to end the game)" % (valor_min, valor_max)
# grab user's value
u = raw_input('User> ')
# convert it to integer one
u = int(u)
# some tests to do
if u == magic_number:
print "You win!"
elif u == 0:
print "You aborted the game!"
break
else:
if u < magic_number:
print "Try again!...Hint: My magic number is bigger than %i." % (u)
else:
print "Try again!...Hint: My magic number is smaller than %i." % (u)
* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-32b w/ xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: ArchLinux-64b w/ xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: ArchLinux-64b w/ xfce4.
why do you first let the user do the input as raw_input
and afterwards convert it to an integer?
(i`d spare my fingers 2 lines by:
u = input ("give number:" )
wouldn`t i?)
I was kidding,
i`m not bored by loops and statements,
but by the useless content of them right now right here.
The long-term-goal is to be able to make scripts which are related
to my system, and not to the users (=i,me) input of numbers-
magic or usual ones.
greetings and thanks
and afterwards convert it to an integer?
(i`d spare my fingers 2 lines by:
u = input ("give number:" )
wouldn`t i?)
I was kidding,
i`m not bored by loops and statements,
but by the useless content of them right now right here.
The long-term-goal is to be able to make scripts which are related
to my system, and not to the users (=i,me) input of numbers-
magic or usual ones.
greetings and thanks
Because it's safer.jalu wrote:why do you first let the user do the input as raw_input
and afterwards convert it to an integer?
(i`d spare my fingers 2 lines by:
u = input ("give number:" )
wouldn`t i?)
* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-32b w/ xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: ArchLinux-64b w/ xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: ArchLinux-64b w/ xfce4.
@Joel:
as i said, i was joking,
i`m aware that i`m not able to decide whats the right and whats the wrong way
in doing things.
But its very good to know, i`ll start doing it that way
(sometimes it seems to be usefull making jokes).
@Dargor:
thanks, i got it in mind.
As i`m a beginner i can`t decide if docus, tutorials etc.
are good or not, so i`m reliant on the info and advices i get.
thanks again,
to all of you
jalu
as i said, i was joking,
i`m aware that i`m not able to decide whats the right and whats the wrong way
in doing things.
But its very good to know, i`ll start doing it that way
(sometimes it seems to be usefull making jokes).
@Dargor:
thanks, i got it in mind.
As i`m a beginner i can`t decide if docus, tutorials etc.
are good or not, so i`m reliant on the info and advices i get.
thanks again,
to all of you
jalu
-
- Posts: 1
- Joined: 2009-02-07 03:24
thanks Lavene,i`ll try ur link.I have just started out with python and I can say, from what I have seen its a pretty cool language. Always, the tutorial that comes with python leaves me pretty much "huh". So, does anyone know of a good tutorial for learning python? I'm considering buying a book, any ideas on that?
-
- Posts: 1
- Joined: 2019-04-02 10:05
Re: looking for a python-tutorial
Hello There,
Thanks for sharing code details but I've asked one question for you can you please tell me this code run which process & second question is that this code run by mac system can you please answer sharing with me & which process to run this code & share details. Otherwise, your any details need you should try Python tutorial & learn all details for python tutorial related otherwise if any question you can ask here.Joel wrote:Tired of loops and conditional statements? Hehe use them bothjalu wrote: As i`m a bit bored of all those
if a > 7:
while i != 4:
Code: Select all
#!/usr/bin/python # A nice library to use here import random # max and min values valor_min = 1 valor_max = 10 # Generate a random number magic_number = random.randrange(valor_min, valor_max); # save user input u = -1 # loop until user inputs the correct number while u != magic_number: # Print a friendly message :) print "I'm a bot, guess my magic number between %i..%i. (note: use zero to end the game)" % (valor_min, valor_max) # grab user's value u = raw_input('User> ') # convert it to integer one u = int(u) # some tests to do if u == magic_number: print "You win!" elif u == 0: print "You aborted the game!" break else: if u < magic_number: print "Try again!...Hint: My magic number is bigger than %i." % (u) else: print "Try again!...Hint: My magic number is smaller than %i." % (u)
-
- Emeritus
- Posts: 2435
- Joined: 2010-12-07 19:55
- Has thanked: 14 times
- Been thanked: 54 times