After quite a while away from Python, I have decided to re-study Python. I
am interested to learn Python to support my love for Cryptography. I have a
first very easy question (did some search on Google but could not find
anything helpful). I realise that this is very basic so be gentle with me.
Hi Ben, you wrote
--- John Carmona <[EMAIL PROTECTED]> wrote:
>Ben I could not get your script working
indentation?
You were right, it is working now, thanks
JC
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
To all that have answered, many thanks. I will check the tutorials that have
been pointed out to me. I have also got the Dive into Python printed and I
will start reading that one too pretty soon.
I am off on holiday starting Tuesday so I won't have the time to study too
much in the next couple
Pujo, Alan, John and Ben, thanks for the input.
Sorry I should have been clearer with the query perhaps.
Alan I am just going through the book "Learning Python" written by Lutz and
Ascher, and this is part of one exercise. I am still having problem in
putting my head around in writting even very
With the help of Pujo Aji I have written this little script that print every
single ASCII code>>
S = [chr(x) for x in range (0,256)]
for x in S:
print x,
The next step is to use the built-in functin ord() in order to convert each
character to an ASCII integer. I have had a look at the ord()
Thanks Kent for the reply, I am actually having trouble to find the solution
of the following exercise:
## Write a for loop that prints the ASCII code of each character in a string
name S.##
I am ok with the for loop, put I don't know how get to print the ASCII code
of each character with a st
I need to print all the ASCII characters within a string, how would I
delimit for example to print the first 100 only? Many thanks
JC
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Got it now, thanks John
JC
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Got it now, thanks.
JC
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
MyText = open('The_text.txt','r').read()
In the above line could someone tell me what the 'r' stand for. Many thanks
JC
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
To all thanks I have got it now!!!
JC
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
copied the URL, paste it in my script in Python and run it (once) did not
get nowhere, then did it a second time, and again did not get nowhere.
JC
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
This is what I did. I have tried the whole field, part of the URL (after the
.com), etc.. I Just get the old 404 not found message.
JC
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Hey Liam thanks again for the hint. I have finally managed to use the
???trans function. But now "apply it to the URL", I am lost again. (I did
apply it to the URL-twice) but nope, nothing is happening. One more hint if
possible.
Thanks
JC
___
Tutor
Terry, thanks very much that was very helpful right at this moment :)
This is what beginners like me needs small example that explain very well
how to use some of the functions. I found sometimes that the explanation on
the book or the documentation going over my head because they don't show a
Thanks Liam, I will start checking this afternoon.
Regards
JC
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
OK I am stuck on this one. I see what I need to do (correct me if I am
wrong). But I need to write a script that will replace each letter by
another one (In this case a --> c etc.). I look at String, List and
Dictionary. I thought I could use the text.replace option but I am not sure.
Anybody t
Hi to everybody reading this thread, can anybody point me to the URL where I
can find these challenges. Many thanks
JC
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Hi Alan, I did not receive personally your last email but I have read it on
the forum.
OK i understand now what you were talking about, sorry it took such a long
time for me to see the solution, the good thing about it is that I am
learning tons.
I will probably post soon again once I hit a wa
OK Alan, I thing I have seen the light!!. Here is the script that Kent and
you asked me to look at modified:
-
def print_options():
print "--"
print "Options:"
print "a. print opt
Hi Alan, sorry for not replying sooner I am right in the middle of setting
up a network at home. Thanks for your email.
OK the situation is that I haven't still found out what the answer is, I
have noticed in the other hand that if I select the option "a" let's say 4
times, I need to enter the
enter "f" first then the
programme ends. What am i missing?
JC
John Carmona wrote:
Thanks for the help Kent, Noel and Alan. Here is my final script (it
seems to be working ok but sometimes if I select "quit the programme", I
need to enter that option 2 or 3 times bef
Thanks for the help Kent, Noel and Alan. Here is my final script (it seems
to be working ok but sometimes if I select "quit the programme", I need to
enter that option 2 or 3 times before it works, is this a bug (I am running
Win XP), please feel free to comment if you thing that something could
Thanks Kent, it is working now. Is this what you meant in your reply?
Because if I set up the main code at the end of the script I was still
getting an error message.
Also, what do I need to use if for example I want my code to rerun once I
have computed let's say a volume. Right now the execut
Hi guys, I am back from my hols.
Jacob S gave me this little exercise to do a little while ago.
1) Make a program to compute the areas of several figures. Make it display a
menu on startup, ask for a choice, and then compute the area of the
figure chosen by asking for dimensions.
2) Make
I am off to sunny Spain for the next 2 weeks and I would like to suspend the
emailing from Python.tutor for that period. Could someone put me in the
right direction on how to do that, thanks.
Regards
JC
___
Tutor maillist - Tutor@python.org
http://ma
Thanks Kristian, it is working fine now. I am learning so much with those
little exercises, I know they are probably very basics to most of the people
of this forum but they are great for a beginner like me. Jacob has sent me a
few exercise to do, some look pretty difficult for my level so surel
Kristian you have said:
-
I can think of 2 ways to accomplish this.
1. Try to convert monthString to an int, use the lookup if that fails.
This might be a good way to learn try/except processing.
Thanks John for your help.
Here is the final script (and it is working)
--
import calendar
MonthName = {'January': 1,'February': 2, 'March': 3,'April': 4
,'May': 5,'June': 6,'July': 7,'August': 8,
Thanks Jacob, I think that should keep me out of the street for a while!
I will get back to you if I have any question
Regards
JC
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Roel you wrote:
-
A dictionary is a data structure containing keys and values that defines
a mapping from each key to its corresponding value. You define it like this:
>>> squares = {1: 1, 10: 100, 4: 15,
Kristian you wrote:
-
This assumes all input as integers; if you want months entered by
name, you'll have to write a conversion routine (hint: use a dict).
---
Thanks Kristian, it works a treat. Now you have set me up with finding out
how to use the months entered by name. If I am stuck I will post again.
Thanks very much
JC
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
I am back, thanks again all to help me sorting out the High_Low guessing
game using time.
Can somebody put me on the right track for the following script. I know how
to use the calendar.prcal command to print the 12 months of choosen year.
But how do you use the prmonth command, if you, for exa
Dear Hoffmann, I am also a Newbie and I am currently going through "A Byte
of Python" tutorial from Swaroop C H.
http://www.byteofpython.info/download?PHPSESSID=c0d52343d90f69f25942f49df9ae7944
If you are completely new to programming like me, you will find that this
tutorial is excellent.
Good
C Smith, Danny and Kent, thanks for the replies.
Here is my programme (I have reinstated the "while loop"
C Smith I like very much your method to get the last digits of a number.
It is WORKING NOW!! You can imagine how long I have spent on that, but I
have learnt so much. Many thanks to all the pe
Thanks Kent I kind of see what you are trying to explain to me, it makes it
easier by trying the different combination.
So even is I change the first line to
import time
My script is still not working properly, I am obviously missing a statement
somewhere, the script return:
Enter a number: 25
Alan and John thanks for the help. I have now this bit of script but it is
not running.
--
from time import *
n = time()
s = str(n)
numb = s[-2:] # last two characters of the string
numb = in
John,
Thanks firstly to point about emailing back using the "Reply to all" option.
Thanks also about the explanation about the difference about the difference
between 32 and "32", being a number and a string respectively, your
explanation was very clear (you can see now my level in programming, b
I am not sure that it is possible to ask that question please feel free to
turn me down if it is going against the forum rules.
I have going through Josh Cogliati tutorial, I am stuck on one of the
exercise. I need to rewrite the high_low.py program (see below) to use the
last two digits of tim
Hi guys, I have typed this programme from the Josh Cogliati manual
-
import calendar
year = input("Type in the year number: ")
calendar.prcal(year)
I get this error message
Traceback (most recent call last):
File "C:/Python24/Example/cal.
Hi there,
I have written (well almost as I copied some lines from an existing example)
this little programme - part of an exercise.
#By J Carmona
#Programme that compute area for
#circle, square, rectangle
def area_rect():
length = input("Length: ")
width = input ("Width: ")
Thanks everybody for their input. It is great to know that there are some
people ready to help.
Ara Kooser, what I meant by this "science", I have meant programming, sorry
if I was not too clear.
Alan, I will check those programming contests you were talking about, but
only when I will feel re
Hi to everyone first, this is my first posting and I hope that I won't make
a mess.
I am 100% newbie (and when I mean newbie it is with a big N).
I decided to have a go at programming and after reading different articles I
decided to have a go at Python (first because it is free, secondly becaus
44 matches
Mail list logo