943,901 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Marked Solved
  • Views: 10086
  • Python RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Mar 27th, 2008
0

Re: Is it too late to learn Python

Compared to Java, Python has simplified a lot of the syntax. It will spoil you, and you may actually have fun.
Reputation Points: 404
Solved Threads: 180
Nearly a Posting Virtuoso
bumsfeld is offline Offline
1,422 posts
since Jul 2005
Mar 27th, 2008
0

Re: Is it too late to learn Python

The proof is in the pudding. Take a small project like creating a monthly calendar and try to do it with Java and then with Python.
Reputation Points: 625
Solved Threads: 211
Posting Virtuoso
Ene Uran is offline Offline
1,704 posts
since Aug 2005
Mar 30th, 2008
0

Re: Is it too late to learn Python

Click to Expand / Collapse  Quote originally posted by ZZucker ...
Look at the syntax of Java and Python. Which one would you rather use?
In that case Java.

Only reason I have never tryed Python is because of the syntax. I feel that is far removed from everything else. Switching from C++ to C to Java to C# is simple, The syntax in the languages are very similar, But that may just be me.
Reputation Points: 21
Solved Threads: 10
Junior Poster
Paul.Esson is offline Offline
181 posts
since Feb 2005
Mar 30th, 2008
0

Re: Is it too late to learn Python

python has defiantly spioled me!

i hate the look of other languages even tho i'd love to learn them.. whenever i try.. i end up going back to python just cause it's so much clearer and quicker to make things.

i just wish it was a bit easier to create standalone programs that don't need the interpreter running. (i've tried py2exe but i just can't get my head round it)
Reputation Points: 26
Solved Threads: 24
Junior Poster
a1eio is offline Offline
140 posts
since Aug 2005
Mar 30th, 2008
0

Re: Is it too late to learn Python

Okay Paul, in your case you use what you are familiar with.

Here is a little Python code, that I have asked people to write in C++, C, Java or C# ...
python Syntax (Toggle Plain Text)
  1. a = 111111111 # that's nine ones
  2. print a * a # 12345678987654321
If it's late in the day and counting off nine ones is difficult you can use a = int('1'*9)
Last edited by vegaseat; Mar 30th, 2008 at 10:41 am.
Moderator
Reputation Points: 1333
Solved Threads: 1403
DaniWeb's Hypocrite
vegaseat is offline Offline
5,792 posts
since Oct 2004
Mar 30th, 2008
0

Re: Is it too late to learn Python

hehe, nicely put vega, i totally forgot about that beautiful aspect of python
Reputation Points: 26
Solved Threads: 24
Junior Poster
a1eio is offline Offline
140 posts
since Aug 2005
Mar 30th, 2008
0

Re: Is it too late to learn Python

The thing about Python that I find more appealing than C, C++, Java, etc. is how you really don't need that many modules to do heavy things. You also aren't required to declare classes and functions to write a simple program.
Last edited by linux; Mar 30th, 2008 at 12:40 pm.
Reputation Points: 118
Solved Threads: 30
Posting Shark
linux is offline Offline
931 posts
since Aug 2006
Mar 31st, 2008
1

Re: Is it too late to learn Python

That scares me a little, How does one implement a rotating counter in python ?

c# Syntax (Toggle Plain Text)
  1. class Program
  2. {
  3. public static void Main(string[] args)
  4. {
  5. ulong a = 111111111; // Thats 9 1's
  6. System.Console.WriteLine((a * a));
  7. }
  8. }

using C++ and .net
c++ Syntax (Toggle Plain Text)
  1. using namespace System;
  2.  
  3. int main(array<System::String ^> ^args)
  4. {
  5. Int64 a = 111111111;
  6. Console::WriteLine( Int64(a * a) );
  7. return 0;
  8. }
java Syntax (Toggle Plain Text)
  1. //Don't have a java compiler but would be somthing along the lines of
  2. long a = 111111111;
  3. System.out.println( (a * a).toString());
Last edited by Paul.Esson; Mar 31st, 2008 at 8:05 am.
Reputation Points: 21
Solved Threads: 10
Junior Poster
Paul.Esson is offline Offline
181 posts
since Feb 2005
Mar 31st, 2008
0

Re: Is it too late to learn Python

sorry and in C
  1. #include <stdio.h>
  2. int main(){
  3. long long a = 111111111;
  4. printf("%lld", a * a );
  5. return 0;
  6. }
Reputation Points: 21
Solved Threads: 10
Junior Poster
Paul.Esson is offline Offline
181 posts
since Feb 2005
Mar 31st, 2008
0

Re: Is it too late to learn Python

Thanks for the samples of C, C++, C# and Java they make Python code look alarmingly simple.

Paul, what C++ compiler are you using?
The open source g++ gives me lots of errors:

Quote ...
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\AtestCON\NineOnes1\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\testCON\NineOnes1\Makefile.win" all
g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"

main.cpp:1: error: expected namespace-name before ';' token

main.cpp:1: error: `<type error>' is not a namespace
main.cpp:3: error: `array' was not declared in this scope
main.cpp:3: error: `System' has not been declared
main.cpp:3: error: `String' was not declared in this scope

main.cpp:3: error: expected primary-expression before '>' token
main.cpp:3: error: expected primary-expression before '^' token
main.cpp:3: error: `args' was not declared in this scope
main.cpp:4: error: expected `,' or `;' before '{' token

make.exe: *** [main.o] Error 1

Execution terminated
Do you really think that this C++ code:
Python Syntax (Toggle Plain Text)
  1. using namespace System;
  2.  
  3. int main(array<System::String ^> ^args)
  4. {
  5. Int64 a = 111111111;
  6. Console::WriteLine( Int64(a * a) );
  7. return 0;
  8. }
is easier to understand than Python:
python Syntax (Toggle Plain Text)
  1. a = 111111111
  2. print a * a
Last edited by ZZucker; Mar 31st, 2008 at 12:19 pm.
Reputation Points: 309
Solved Threads: 43
Practically a Master Poster
ZZucker is offline Offline
676 posts
since Jan 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: question of buttion click()
Next Thread in Python Forum Timeline: Variable from Dictionary Value keeps []





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC