[Courses] [python] Lesson 1: Hello world

Hrvoje G hrvojegor at gmail.com
Wed Jun 22 19:52:58 UTC 2011


Hello everyone.
I'm sorry to be a little late.

Anyways, I'm Harry and I have a strong background in PHP.

Here's my homework answers:

*1. I'm interested in hearing what version of Python everybody is running,
  on which operating system, distro and version. Please post your results!
  Especially if python3 is the default, or if you have any other problems
  running the examples.
*
My work machine is Windows XP machine.
python --version gives
Python 2.7.2

*2. Why are there two commas in
   print "Hello,", name
   ? What do you think the difference is between them?
*
The first comma is a part of the constant string and I would say the second
one is the special form of concatenation operator for print function. I know
that in PHP you can do the same with echo command.

*3. Anyone know why the language was named Python?*

I have no idea.

Some things I tried after I was finished:

1. I was wondering if I could end lines with ";" as I'm used to that - turns
out you can.
print "Hello world" is the same as
print "Hello world";
 - am I correct?

2. I was wondering if one cold use both types of quotes - " and '. Turns out
you can.
3. I was wondering if I could multiply two numbers that I got from raw_input
but it seems raw_input returns a string and it looks like Python doesn't
convert types automatically.

Thanx for this great course.

  ================= Homework =========================

>
> Normally I'll have programming assignments for homework -- some easy,
> some harder. But for this first lesson, I just have a few questions.
> Post your answers to the list -- if someone beats you do it, don't
> worry about it, you're not being graded on who answers.
>
>
>
>
>
> _______________________________________________
> Courses mailing list
> Courses at linuxchix.org
> http://mailman.linuxchix.org/mailman/listinfo/courses
>
>


More information about the Courses mailing list