473,691 Members | 2,469 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Newbie to python --- why should i learn !

Hi,

i was reading/learning some hello world program in python.
I think its very simillar to Java/C++/C#. What's different (except
syntax) ?

what can i do easily with python which is not easy in c++/java !?

Tnx,
Raxit
www.mykavita.com
Jun 27 '08 #1
16 1876
On 2008-05-08, Ra***@MyKavita. com <ra************ @gmail.comwrote :
Hi,

i was reading/learning some hello world program in python.
I think its very simillar to Java/C++/C#. What's different (except
syntax) ?
Yes, and all programs that people write typically look like the hello world
program.
Look at some real-world programs for a comparison, for example the Python
Cookbook: http://aspn.activestate.com/ASPN/Cookbook/Python/
what can i do easily with python which is not easy in c++/java !?
- be productive in programming, rather than hassling with declaring all kind of
stuff first.

- skip compile step.

On the other hand, if you typically write hello world programs, don't bother.
You won't see the difference.

Sincerely,
Albert
Jun 27 '08 #2
On May 8, 5:25 am, "Ra...@MyKavita .com" <raxitsheth2... @gmail.com>
wrote:
Hi,

i was reading/learning some hello world program in python.
I think its very simillar to Java/C++/C#. What's different (except
syntax) ?

what can i do easily with python which is not easy in c++/java !?
Are you a newbie to Python, or to programming in general? I'll assume
you are a newbie to programming in general because of that last
question you asked. Things in Python are easier than in almost any
other programming language. Here are three Hello World programs:

--------------C++---------------------
#include <iostream.h>

main()
{
cout << "Hello World!";
return 0;
}
--------------------------------------

-------------Java---------------------
class HW {
public static void main(String args[]) {
System.out.prin tln("Hello World!");
}
}
--------------------------------------

------------Python--------------------
print "Hello World!"
--------------------------------------

--------------C#----------------------
<I have no idea!>
--------------------------------------

I think you can clearly see which one is easiest. Of course, that
doesn't mean that the "easiest" language is always the "best"
language, although it is a strong point. But ease of use is just a one-
in-a-million characteristic of Python. If you're a total beginner, I'd
recommend you learning the one that attracts you the most.
Jun 27 '08 #3
Ra***@MyKavita. com ha scritto:
Hi,

i was reading/learning some hello world program in python.
I think its very simillar to Java/C++/C#. What's different (except
syntax) ?
well, it's similar in the sense that it is a programming language. So
you can say that assembly is similar to BASIC, but that both are
different from finnish, but from a programmer's point of view, they're
all rather different languages.
what can i do easily with python which is not easy in c++/java !?
generally speaking python is said to be easier to pick up for a pletora
of reasons. technically speaking, it is not, for example, strongly
typed, nor it forces you to use a programming paradigm like object
oriented programming.
This means that if you just want to see your name printed on the screen
you can simply write:

print "raxit"

and get the work done. to understand it you just have to understand some
basics like what is a string and what is a statement.

in java, for example, it would look like:

public class HelloWorld {
public static void main(String[] args) {
System.out.prin tln("raxit");
}
}

in short, to obtain the same result (limited to this case) you have to
write 650% more code and you're forced to know what is a class, what
namespace means, what is a function (and arguments) and what are methods
and the dot notation and an array. not that you won't encounter all of
them learning python, but you're presented with all of them, all at
once, in the moment where you just want to write the simplest program.
that's why a typical java beginner's guide starts with ditto examples
and adds: "ignore everything for the moment". i hate when i have to
ignore things of a code that i'm writing!

the same applies to C# and, to a certain extend, C++ that is a much
older language and present different learning problems.
Now, what can you do with python? Virtually everything (network
programming, game programming, server side scripting). In most cases, it
would run slower than it would do with the other languages (even slower
than the slow java). You won't do drivers or kernels in python, but you
won't even code them in java or C#.
the programs you'll write will mostly run on a number of different
platform, like java programs. porting a c++ is a bit tougher. at the
moment there is project (mono) that is porting the .net platform (where
c# runs) to multiple platforms, but basically, if you write a c# program
you're programming for windows.
hope it helps
Tnx,
Raxit
www.mykavita.com
Jun 27 '08 #4
Hi Raxit,

One of the the tempting features of Python is that it is fun to code
in Python. If you are really trying to learn python, you should read
Adventures with Neko (http://gnuvision.com/books/pybook/) . It is an
introductory book on Python programming for school children by Mr.
Pramode CE.

It is fun for children (when I tried it, me too liked it) to do
programming with Neko, the cat. I am sure that it will be a fun filled
learning experience for you.

Regards,

Maxin B. John

pistacchio wrote:
Ra***@MyKavita. com ha scritto:
Hi,

i was reading/learning some hello world program in python.
I think its very simillar to Java/C++/C#. What's different (except
syntax) ?

well, it's similar in the sense that it is a programming language. So
you can say that assembly is similar to BASIC, but that both are
different from finnish, but from a programmer's point of view, they're
all rather different languages.
what can i do easily with python which is not easy in c++/java !?

generally speaking python is said to be easier to pick up for a pletora
of reasons. technically speaking, it is not, for example, strongly
typed, nor it forces you to use a programming paradigm like object
oriented programming.
This means that if you just want to see your name printed on the screen
you can simply write:

print "raxit"

and get the work done. to understand it you just have to understand some
basics like what is a string and what is a statement.

in java, for example, it would look like:

public class HelloWorld {
public static void main(String[] args) {
System.out.prin tln("raxit");
}
}

in short, to obtain the same result (limited to this case) you have to
write 650% more code and you're forced to know what is a class, what
namespace means, what is a function (and arguments) and what are methods
and the dot notation and an array. not that you won't encounter all of
them learning python, but you're presented with all of them, all at
once, in the moment where you just want to write the simplest program.
that's why a typical java beginner's guide starts with ditto examples
and adds: "ignore everything for the moment". i hate when i have to
ignore things of a code that i'm writing!

the same applies to C# and, to a certain extend, C++ that is a much
older language and present different learning problems.
Now, what can you do with python? Virtually everything (network
programming, game programming, server side scripting). In most cases, it
would run slower than it would do with the other languages (even slower
than the slow java). You won't do drivers or kernels in python, but you
won't even code them in java or C#.
the programs you'll write will mostly run on a number of different
platform, like java programs. porting a c++ is a bit tougher. at the
moment there is project (mono) that is porting the .net platform (where
c# runs) to multiple platforms, but basically, if you write a c# program
you're programming for windows.
hope it helps
Tnx,
Raxit
www.mykavita.com
Jun 27 '08 #5
C#

using System;
namespace HelloWorld
{
Class HelloWorld
{
static void Main(String[] args)
{
Console.WriteLi ne("Hello World");
}
}
}
Jun 27 '08 #6
hello,
I have programmed co insidentally in all the 3 languages.
so out of my experience of 10 + years, I got my personal share of
reasons to prefer python over the other 2 namely c++ and java.
firstly as every one has already explained, python is easy, fun to
learn and can do many things much productively for programmers
compared to c++ and java.
and c# is no better in that.
besides, now a days python has become much much faster in some cases
faster than java.
compare pygtk vs java swing.
python has huge amount of libraries/ modules which are as easy to use
as the language itself.
the syntax difference mentioned in the first email on this thread
makes a huge difference when the code becomes complex and the number
of lines increase.
so there are a lot of reasons to prefer python over java.
for the question "what can I do in python easier than other languages
" is not a question to be answered because it all depends on how one
associates the problem space with the language space in which the
programmer wishes to express the solution.
there will be people who will say "java is much better choice for
large scale programmes " but people like myself will always question
that.
happy hacking.
Krishnakant.
Jun 27 '08 #7
On Thu, May 8, 2008 at 7:25 AM, Ra***@MyKavita. com
<ra************ @gmail.comwrote :
Hi,

i was reading/learning some hello world program in python.
I think its very simillar to Java/C++/C#. What's different (except
syntax) ?

what can i do easily with python which is not easy in c++/java !?
Programming in a pure duck typing style
http://en.wikipedia.org/wiki/Duck_typing
Tnx,
Raxit
www.mykavita.com
--
http://mail.python.org/mailman/listinfo/python-list


--
Eduardo de Oliveira Padoan
http://www.advogato.org/person/eopadoan/
http://twitter.com/edcrypt
Bookmarks: http://del.icio.us/edcrypt
Jun 27 '08 #8
On Thu, 08 May 2008 04:17:01 -0700, s0suk3 wrote:
Are you a newbie to Python, or to programming in general? I'll assume
you are a newbie to programming in general because of that last
question you asked. Things in Python are easier than in almost any
other programming language. Here are three Hello World programs:
Counterexamples for quite short "greetings" in other programming languages:

(Free)BASIC::

Print "Hello World!"

OCaml::

print_string "Hello World!" ;;

Io::

"Hello World!" linePrint

Haskell::

main = putStrLn "Hello World!"

Ciao,
Marc 'BlackJack' Rintsch
Jun 27 '08 #9
Marc 'BlackJack' Rintsch ha scritto:
On Thu, 08 May 2008 04:17:01 -0700, s0suk3 wrote:
>Are you a newbie to Python, or to programming in general? I'll assume
you are a newbie to programming in general because of that last
question you asked. Things in Python are easier than in almost any
other programming language. Here are three Hello World programs:

Counterexamples for quite short "greetings" in other programming languages:

(Free)BASIC::

Print "Hello World!"
freebasic is another language i'd point out to a newbie, even if it is
not as multiplatform as python if. it has a decent community and a large
amount of libraries. it doesn't let you explore functional or, worse,
object oriented programming nor you can write server side programs with it.
The others are examples of easy "hello world" languages, but, passed
that, i think they don't have the same capabilities of python on terms
of support, kind of programs you can write and even overall complexity
(haskell forces you to functional programming, io is really a minor
language, ocalm forces you to di OOP and, if writing hello world is
simple, on the other hand ir may have lines of code that read like:

| [] -[]

and that negatively compesate the easy way you can write "hello world"
OCaml::

print_string "Hello World!" ;;

Io::

"Hello World!" linePrint

Haskell::

main = putStrLn "Hello World!"

Ciao,
Marc 'BlackJack' Rintsch
Jun 27 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
1716
by: karokat | last post by:
Hi, I want to learn how to program and python seems to be the most intuitive language according to various internet sources - but I'm not sure if it's best for newbies... please advise.. Anyway, my first project I would like to make is a simple proggie - a simple note 'library', with basic formattable text, to store, edit and access my notes. Express Notes is the prog I currently use but there's things in it I want to customise to my personal...
4
1454
by: Grayham | last post by:
Hi all I am new to this group so 'Hello All' I have a PC which is running linux and in it have installed a digital satellite card. I would like to write some software to access the card, tune it and bring back video. Basically a home brew DVB-s application. Being a non/new programmer (apart from some basic too many years ago) I decided to teach my self Python as from what i have read it's an easy and
0
918
by: Sells, Fred | last post by:
write working programs
3
945
by: andrew.smith.cpp | last post by:
I have Heard About "Python" its a OOD Language. i have to Learn it where from i should start it. i have python compiler at linux Platform. anyone can suggest me about it. Thanks In advance.
0
803
by: Sells, Fred | last post by:
get a python-aware editor. I vary between emacs and Eclipse, depending on my mood and the size of the project.
7
1509
by: idiolect | last post by:
Hi all - Sorry to plague you with another newbie question from a lurker. Hopefully, this will be simple. I have a list full of RGB pixel values read from an image. I want to test each RGB band value per pixel, and set it to something else if it meets or falls below a certain threshold - i.e., a Red value of 0 would be changed to 50. I've built my list by using a Python Image Library statement akin to the following:
0
1715
by: Edwin.Madari | last post by:
-----Original Message----- statement prepared first and executed many times with exectemany - db API http://www.python.org/dev/peps/pep-0249/ inline statemets can be exeucuted only. hope that helps Edwin
10
1401
by: Mladen Gogala | last post by:
I am a Python newbie who decided to see what that Python fuss is all about. Quite frankly, I am a bit perplexed. After having had few months of experience with Perl (started in 1994 with Perl v4, and doing it ever since) , here is what perplexes me: perl -e '@a=(1,2,3); map { $_*=2 } @a; map { print "$_\n"; } @a;' The equivalent in Python looks like this: Python 2.5.1 (r251:54863, Jun 15 2008, 18:24:51)
0
8533
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9079
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8795
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7624
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6457
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5813
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4322
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2966
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2229
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.