usenet-nospam at seebs.net
Thu Oct 7 05:02:23 CEST 2010
On 2010-10-06, <fkrafi at aboutrafi.net23.net> <fkrafi at aboutrafi.net23.net> wrote:
> plz can u convert this cpp file into python i need that badly as soon as
> possible... I am new to python. I just wanna learn it....
Having come to realize that this is a homework problem, I would of course
be glad to.
The original program:
int a, n;
freopen("input.txt", "r", stdin);
for(int i=1; i<=n; i++)
So, let's convert this.
a = [random.randint(-2147483648,2147483647) for i in range(0,100)]
n = random.randint(-2147483648)
sys.stdin = open("input.txt", "r")
I'm not sure how much good this will do you. It seems to me that you
might get better results translating a program which was not obviously
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam at seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.
More information about the Python-list