| | |
Is it too late to learn Python
Thread Solved |
•
•
•
•
Look at the syntax of Java and Python. Which one would you rather use?
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.
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)
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)
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# ...
If it's late in the day and counting off nine ones is difficult you can use
Here is a little Python code, that I have asked people to write in C++, C, Java or C# ...
python Syntax (Toggle Plain Text)
a = 111111111 # that's nine ones print a * a # 12345678987654321
a = int('1'*9) Last edited by vegaseat; Mar 30th, 2008 at 10:41 am.
May 'the Google' be with you!
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.
Toshiba M115 ● 1.49 GB DDR-2 RAM ● 1.6 GHz Centrino Duo ● 80GB HDD ● Windows XP Media Center Edition
That scares me a little, How does one implement a rotating counter in python ?
using C++ and .net
c# Syntax (Toggle Plain Text)
class Program { public static void Main(string[] args) { ulong a = 111111111; // Thats 9 1's System.Console.WriteLine((a * a)); } }
using C++ and .net
c++ Syntax (Toggle Plain Text)
using namespace System; int main(array<System::String ^> ^args) { Int64 a = 111111111; Console::WriteLine( Int64(a * a) ); return 0; }
java Syntax (Toggle Plain Text)
//Don't have a java compiler but would be somthing along the lines of long a = 111111111; System.out.println( (a * a).toString());
Last edited by Paul.Esson; Mar 31st, 2008 at 8:05 am.
sorry and in C
c Syntax (Toggle Plain Text)
#include <stdio.h> int main(){ long long a = 111111111; printf("%lld", a * a ); return 0; }
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:
Do you really think that this C++ code:
is easier to understand than Python:
Paul, what C++ compiler are you using?
The open source g++ gives me lots of errors:
•
•
•
•
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
Python Syntax (Toggle Plain Text)
using namespace System; int main(array<System::String ^> ^args) { Int64 a = 111111111; Console::WriteLine( Int64(a * a) ); return 0; }
python Syntax (Toggle Plain Text)
a = 111111111 print a * a
Last edited by ZZucker; Mar 31st, 2008 at 12:19 pm.
Never argue with idiots, they'll just bring you down to their level and beat you with their experience.
![]() |
Similar Threads
- I want to get started learning a programming language (Computer Science)
- Tkinter Countdown Timer problems. (Python)
- my first program.... (Python)
Other Threads in the Python Forum
- Previous Thread: question of buttion click()
- Next Thread: Variable from Dictionary Value keeps []
| Thread Tools | Search this Thread |
abrupt accessdenied anti apache application approximation argv array beginner book builtin calculator change converter countpasswordentry curved dan08 dictionaries dictionary dynamic edit enter examples file float format function gui homework import inches input java keyboard lapse launcher library line lines linux list lists loop microphone mouse movingimageswithpygame mysqlquery newb number numbers numeric output parameters parsing path phonebook plugin port prime programming projects py2exe pygame pyopengl pysimplewizard python random recursion redirect remote reverse scrolledtext session simple software sprite statictext string strings syntax table terminal text textarea thread threading time tlapse trick tuple tutorial twoup ubuntu unicode unit urllib urllib2 variable wordgame wxpython






