Level 0
Moderators: UncleTimmy, mjpieters
Enjoying the challenge? Need a hint?Make a donation and help keep the site running! -thesamet
30 posts
• Page 2 of 2 • 1, 2
Is the site still fully operational?
Because I pasted the answer nnnnn.html and was faced with page not found. I don't think the answer is wrong. Unless Ruby and Python return different answers.
Re: Level 0
I have solved this problem by typing "http://www.pythonchallenge.com/pc/def/[the correct answer].html". However when I tried to reach the solution by typing "http://www.pythonchallenge.com/ppc/def/[the correct answer].html" or "http://www.pythonchallenge.com/ppc/def/0.html", I got both "404 Not Found" errors.
Can anybody help me out? Thanks.
Can anybody help me out? Thanks.
Typing "http://www.pythonchallenge.com/pc/def/[the correct answer].html" redirects you to level one whose URL is "http://www.pythonchallenge.com/pc/def/[level 1's URL].html". Once you get there, you can go to "http://www.pythonchallenge.com/pcc/def/[level 1's URL].html" to check out the solution page.
Note that it's pcc and not ppc.
Note that it's pcc and not ppc.
Re: Level 0
Peetoon wrote:Typing "http://www.pythonchallenge.com/pc/def/[the correct answer].html" redirects you to level one whose URL is "http://www.pythonchallenge.com/pc/def/[level 1's URL].html". Once you get there, you can go to "http://www.pythonchallenge.com/pcc/def/[level 1's URL].html" to check out the solution page.
Note that it's pcc and not ppc.
fuh, little hint and voala
Re: Level 0
is this like the competition ACM ? I submit my code than I will see whether I accept or wrong answer?
Hello all buyer
I'm seller and alway sell CC fresh with good balance.
I hope u good customers and will be long-term cooperation
* www.cv2store.net is the best automatic sell cvv online store with the good rate 90-95% vaild fresh cvv with cheap price
CVV ON SHOP ONLY SELL US CANADA UK ( BUY CC EU , ASIA , AU .... contact yahoo : cvv_store )
Exchanger WU to Lr
100$ WU = 95 Lr
200$ WU = 190Lr
.....
Price CCV
- Us Visa/mas = 2.5$ / 1cc
Us Amex/disco = 5$ / 1cc
Us fullz = 20$ / 1cc ( full name , state , zipcode , address , phone number , ssn , dob, pin...)
- Canada visa/mas = 7$ / 1cc
- CA amex = 10$ / 1cc
CA fullz = 35$/ 1cc ( full name , state , zipcode , address , phone number , ssn , dob, pin...)
- UK visa/mas = 8$ / 1cc
- Uk amex/dis = 10$/ 1cc
- AU visa/mas = 10$ / 1cc
- Au amex/dis = 12$/ 1cc
- EU / EU fullz = 50$ / 1cc ( full name , state , zipcode , address , phone number , ssn , dob, pin...)
Italy visa/mas = 17$ / 1cc
Italy amex/dis = 20$ / 1cc
Ireland visa/mas = 17$ / 1cc
Ireland amex/disco = 20$/ 1cc
France visa/mas = 17$/1cc
France amex/disco = 20$ / 1cc
Germany visa/mas = 17$/ 1cc
Ger amex/disco = 20$/ 1cc
Norway visa/mas = 17$/ 1cc
Norway amex/disco = 20$/ 1cc
if u want good warranty u can contact me YH : cvv_store
Mail : cvv_store@yahoo.com
Buy throught yahoo we will warranty cvv 24 hours
If buy from shop only 20 min
Because some buyer not good , buy and kill cc so fast then site will change cc
- The checking fee is $0.1 for VALID cards
u can buy test and if good we deal long time
Accept payment Lr if u dont have Lr we will accept Westerunion Money gram
* Min accept Western union Money gram = 100$
Also have Gift itunes XX / XM ( contact YH : cvv_store ) , walmart - Egift card
gift itunes 50$ price 20$ ( buy 50 more 15$ / 1 )
Gift itunes 100$ price 35$ ( buy 50 more 30$ / 1 )
E-G walmart 100$ = 35$
E-G walmart 150$ = 50$
Mail pass login acc amazon , ebay , paypal , apple , walmart.... ( aol , hotmail , gmail, verizon , comcast ... )
1000 mail pass uncheck = 25$
1000 mail pass checker = 50$
If buy 5k mail pass i will discount for u
SITE : www.cv2store.net
--------------- Thanks u ----------
I'm seller and alway sell CC fresh with good balance.
I hope u good customers and will be long-term cooperation
* www.cv2store.net is the best automatic sell cvv online store with the good rate 90-95% vaild fresh cvv with cheap price
CVV ON SHOP ONLY SELL US CANADA UK ( BUY CC EU , ASIA , AU .... contact yahoo : cvv_store )
Exchanger WU to Lr
100$ WU = 95 Lr
200$ WU = 190Lr
.....
Price CCV
- Us Visa/mas = 2.5$ / 1cc
Us Amex/disco = 5$ / 1cc
Us fullz = 20$ / 1cc ( full name , state , zipcode , address , phone number , ssn , dob, pin...)
- Canada visa/mas = 7$ / 1cc
- CA amex = 10$ / 1cc
CA fullz = 35$/ 1cc ( full name , state , zipcode , address , phone number , ssn , dob, pin...)
- UK visa/mas = 8$ / 1cc
- Uk amex/dis = 10$/ 1cc
- AU visa/mas = 10$ / 1cc
- Au amex/dis = 12$/ 1cc
- EU / EU fullz = 50$ / 1cc ( full name , state , zipcode , address , phone number , ssn , dob, pin...)
Italy visa/mas = 17$ / 1cc
Italy amex/dis = 20$ / 1cc
Ireland visa/mas = 17$ / 1cc
Ireland amex/disco = 20$/ 1cc
France visa/mas = 17$/1cc
France amex/disco = 20$ / 1cc
Germany visa/mas = 17$/ 1cc
Ger amex/disco = 20$/ 1cc
Norway visa/mas = 17$/ 1cc
Norway amex/disco = 20$/ 1cc
if u want good warranty u can contact me YH : cvv_store
Mail : cvv_store@yahoo.com
Buy throught yahoo we will warranty cvv 24 hours
If buy from shop only 20 min
Because some buyer not good , buy and kill cc so fast then site will change cc
- The checking fee is $0.1 for VALID cards
u can buy test and if good we deal long time
Accept payment Lr if u dont have Lr we will accept Westerunion Money gram
* Min accept Western union Money gram = 100$
Also have Gift itunes XX / XM ( contact YH : cvv_store ) , walmart - Egift card
gift itunes 50$ price 20$ ( buy 50 more 15$ / 1 )
Gift itunes 100$ price 35$ ( buy 50 more 30$ / 1 )
E-G walmart 100$ = 35$
E-G walmart 150$ = 50$
Mail pass login acc amazon , ebay , paypal , apple , walmart.... ( aol , hotmail , gmail, verizon , comcast ... )
1000 mail pass uncheck = 25$
1000 mail pass checker = 50$
If buy 5k mail pass i will discount for u
SITE : www.cv2store.net
--------------- Thanks u ----------
Hello all buyer
I'm seller and alway sell CC fresh with good balance.
I hope u good customers and will be long-term cooperation
* www.cv2store.net is the best automatic sell cvv online store with the good rate 90-95% vaild fresh cvv with cheap price
CVV ON SHOP ONLY SELL US CANADA UK ( BUY CC EU , ASIA , AU .... contact yahoo : cvv_store )
Exchanger WU to Lr
100$ WU = 95 Lr
200$ WU = 190Lr
.....
Price CCV
- Us Visa/mas = 2.5$ / 1cc
Us Amex/disco = 5$ / 1cc
Us fullz = 20$ / 1cc ( full name , state , zipcode , address , phone number , ssn , dob, pin...)
- Canada visa/mas = 7$ / 1cc
- CA amex = 10$ / 1cc
CA fullz = 35$/ 1cc ( full name , state , zipcode , address , phone number , ssn , dob, pin...)
- UK visa/mas = 8$ / 1cc
- Uk amex/dis = 10$/ 1cc
- AU visa/mas = 10$ / 1cc
- Au amex/dis = 12$/ 1cc
- EU / EU fullz = 50$ / 1cc ( full name , state , zipcode , address , phone number , ssn , dob, pin...)
Italy visa/mas = 17$ / 1cc
Italy amex/dis = 20$ / 1cc
Ireland visa/mas = 17$ / 1cc
Ireland amex/disco = 20$/ 1cc
France visa/mas = 17$/1cc
France amex/disco = 20$ / 1cc
Germany visa/mas = 17$/ 1cc
Ger amex/disco = 20$/ 1cc
Norway visa/mas = 17$/ 1cc
Norway amex/disco = 20$/ 1cc
if u want good warranty u can contact me YH : cvv_store
Mail : cvv_store@yahoo.com
Buy throught yahoo we will warranty cvv 24 hours
If buy from shop only 20 min
Because some buyer not good , buy and kill cc so fast then site will change cc
- The checking fee is $0.1 for VALID cards
u can buy test and if good we deal long time
Accept payment Lr if u dont have Lr we will accept Westerunion Money gram
* Min accept Western union Money gram = 100$
Also have Gift itunes XX / XM ( contact YH : cvv_store ) , walmart - Egift card
gift itunes 50$ price 20$ ( buy 50 more 15$ / 1 )
Gift itunes 100$ price 35$ ( buy 50 more 30$ / 1 )
E-G walmart 100$ = 35$
E-G walmart 150$ = 50$
Mail pass login acc amazon , ebay , paypal , apple , walmart.... ( aol , hotmail , gmail, verizon , comcast ... )
1000 mail pass uncheck = 25$
1000 mail pass checker = 50$
If buy 5k mail pass i will discount for u
SITE : www.cv2store.net
--------------- Thanks u ----------
I'm seller and alway sell CC fresh with good balance.
I hope u good customers and will be long-term cooperation
* www.cv2store.net is the best automatic sell cvv online store with the good rate 90-95% vaild fresh cvv with cheap price
CVV ON SHOP ONLY SELL US CANADA UK ( BUY CC EU , ASIA , AU .... contact yahoo : cvv_store )
Exchanger WU to Lr
100$ WU = 95 Lr
200$ WU = 190Lr
.....
Price CCV
- Us Visa/mas = 2.5$ / 1cc
Us Amex/disco = 5$ / 1cc
Us fullz = 20$ / 1cc ( full name , state , zipcode , address , phone number , ssn , dob, pin...)
- Canada visa/mas = 7$ / 1cc
- CA amex = 10$ / 1cc
CA fullz = 35$/ 1cc ( full name , state , zipcode , address , phone number , ssn , dob, pin...)
- UK visa/mas = 8$ / 1cc
- Uk amex/dis = 10$/ 1cc
- AU visa/mas = 10$ / 1cc
- Au amex/dis = 12$/ 1cc
- EU / EU fullz = 50$ / 1cc ( full name , state , zipcode , address , phone number , ssn , dob, pin...)
Italy visa/mas = 17$ / 1cc
Italy amex/dis = 20$ / 1cc
Ireland visa/mas = 17$ / 1cc
Ireland amex/disco = 20$/ 1cc
France visa/mas = 17$/1cc
France amex/disco = 20$ / 1cc
Germany visa/mas = 17$/ 1cc
Ger amex/disco = 20$/ 1cc
Norway visa/mas = 17$/ 1cc
Norway amex/disco = 20$/ 1cc
if u want good warranty u can contact me YH : cvv_store
Mail : cvv_store@yahoo.com
Buy throught yahoo we will warranty cvv 24 hours
If buy from shop only 20 min
Because some buyer not good , buy and kill cc so fast then site will change cc
- The checking fee is $0.1 for VALID cards
u can buy test and if good we deal long time
Accept payment Lr if u dont have Lr we will accept Westerunion Money gram
* Min accept Western union Money gram = 100$
Also have Gift itunes XX / XM ( contact YH : cvv_store ) , walmart - Egift card
gift itunes 50$ price 20$ ( buy 50 more 15$ / 1 )
Gift itunes 100$ price 35$ ( buy 50 more 30$ / 1 )
E-G walmart 100$ = 35$
E-G walmart 150$ = 50$
Mail pass login acc amazon , ebay , paypal , apple , walmart.... ( aol , hotmail , gmail, verizon , comcast ... )
1000 mail pass uncheck = 25$
1000 mail pass checker = 50$
If buy 5k mail pass i will discount for u
SITE : www.cv2store.net
--------------- Thanks u ----------
Re: Level 0
I honestly don't understand why one would use the Python code
Python REPL
when instead one could simply use the Java code:
TwoRaisedThirtyEight.java
TwoRaisedThirtyEightTest.java
Strings.java
StringsTest.java
Numbers.java
NumbersTest.java
Justin
Python REPL
when instead one could simply use the Java code:
TwoRaisedThirtyEight.java
- Code:
/*
* Copyright (C) 2013 Justin Hanekom <justin.hanekom@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 3 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
package ca.kjmj;
import ca.kjmj.lang.Numbers;
import ca.kjmj.lang.Strings;
/**
* Prints 2 to the power of 38
*
* @version 1.0
* @author Justin Hanekom
*
*/
public final class TwoRaisedThirtyEight {
/**
* Prints 2 raised to the power of 38 to the standard output stream
*
* @param args
* command-line arguments (not used)
* @since 1.0
*/
public static void main(final String[] args) {
System.out.println(Strings.rightAlign(Numbers
.createDefaultDecimalFormat().format(Math.pow(2, 38)),
TwoRaisedThirtyEight.OUTPUT_WIDTH));
}
/**
* width of the resulting output string that is printed to the standard
* output stream
*/
private static final int OUTPUT_WIDTH = 20;
/**
* Default constructor - suppressed because this class cannot be
* instantiated
*/
private TwoRaisedThirtyEight() {
throw new AssertionError("this class cannot be instantiated");
}
}
TwoRaisedThirtyEightTest.java
- Code:
/*
* Copyright (C) 2013 Justin Hanekom <justin.hanekom@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 3 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
package ca.kjmj;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import org.junit.Assert;
import org.junit.Test;
public class TwoRaisedThirtyEightTest {
@Test
public void testPrintsTwoRaisedThirtyEight() {
final ByteArrayOutputStream out = new ByteArrayOutputStream();
System.setOut(new PrintStream(out));
TwoRaisedThirtyEight.main(null);
Assert.assertEquals(out.toString(), " 274,877,906,944\n");
}
}
Strings.java
- Code:
/*
Copyright (C) 2013 Justin Hanekom <justin.hanekom@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package ca.kjmj.lang;
/**
* Contains additional functionality for the built-in String class
*
* @version 1.0
* @author Justin Hanekom
*
*/
public final class Strings {
/**
* Left aligns the string str in a string of length width. The string is
* padded to the right with spaces (' ') if necessary
*
* @param str
* the string to left-align, may be null
* @param width
* the length to pad the string to
* @return left aligned string; returns the original string if it is null or
* if no padding is necessary
* @throws IllegalArgumentException
* if width is less than or equal to 0
* @since 1.0
*/
public static final String leftAlign(final String str, final int width) {
if (str == null) {
return null;
}
if (width <= 0) {
throw new IllegalArgumentException(
"width must be greater than zero: " + width);
}
return String.format("%1$-" + width + "s", str);
}
/**
* Right aligns the string str in a string of length width. The string is
* padded to the left with spaces (' ') if necessary
*
* @param str
* the string to right-align, may be null
* @param width
* the length to pad the string to
* @return right aligned string; returns the original string if it is null
* or if no padding is necessary
* @throws IllegalArgumentException
* if width is less than or equal to 0
* @since 1.0
*/
public static final String rightAlign(final String str, final int width) {
if (str == null) {
return null;
}
if (width <= 0) {
throw new IllegalArgumentException(
"width must be greater than zero: " + width);
}
return String.format("%1$" + width + "s", str);
}
/**
* Default constructor - suppressed because this class cannot be
* instantiated
*/
private Strings() {
throw new AssertionError("this class cannot be instantiated");
}
}
StringsTest.java
- Code:
/*
Copyright (C) 2013 Justin Hanekom <justin.hanekom@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package ca.kjmj.lang;
import junit.framework.Assert;
import org.junit.Test;
public class StringsTest {
@Test(expected = IllegalAccessException.class)
public void testCannotCreateAStringsInstance()
throws IllegalAccessException, InstantiationException,
ClassNotFoundException {
Class.forName("ca.kjmj.lang.Strings").newInstance();
}
@Test
public void testLeftAlignPadsRightWithSpaces() {
Assert.assertEquals("Strings.leftAlign() should pad the right-hand "
+ "side with space characters", "xyz ",
Strings.leftAlign("xyz", 4));
}
@Test
public void testLeftAlignReturnsNullIfOriginalStringIsNull() {
Assert.assertNull("Strings.leftAlign() should return null if given "
+ "a null as the string to left-align",
Strings.leftAlign(null, 1));
}
@Test
public void testLeftAlignReturnsOriginalStringIfWidthExceeded() {
Assert.assertEquals("Strings.leftAlign() should return the given "
+ "string if the string is larger than the requested width",
"xyz", Strings.leftAlign("xyz", 1));
}
@Test(expected = IllegalArgumentException.class)
public void testLeftAlignThrowsIllegalArgumentExceptionIfWidthZeroOrLess() {
Strings.leftAlign("xyz", -1);
}
@Test
public void testRightAlignPadsLeftWithSpaces() {
Assert.assertEquals("Strings.rightAlign() should pad the left-hand "
+ "side with space characters", " xyz",
Strings.rightAlign("xyz", 4));
}
@Test
public void testRightAlignReturnsNullIfOriginalStringIsNull() {
Assert.assertNull("Strings.rightAlign() should return null if given "
+ "a null as the string to right-align",
Strings.rightAlign(null, -1));
}
@Test
public void testRightAlignReturnsOriginalStringIfWidthExceeded() {
Assert.assertEquals("Strings.rightAlign() should return the given "
+ "string if the string is larger than the requested width",
"xyz", Strings.rightAlign("xyz", 3));
}
@Test(expected = IllegalArgumentException.class)
public void testRightAlignThrowsIllegalArgumentExceptionIfWidthZeroOrLess() {
Strings.leftAlign("xyz", 0);
}
}
Numbers.java
- Code:
/*
Copyright (C) 2013 Justin Hanekom <justin.hanekom@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package ca.kjmj.lang;
import java.text.DecimalFormat;
/**
* Contains additional functionality for the built-in Number-based classes
*
* @version 1.0
* @author Justin Hanekom
*
*/
public final class Numbers {
/**
* @return newly created DecimalFormat object for the default locale
* @since 1.0
*/
public static final DecimalFormat createDefaultDecimalFormat() {
return new DecimalFormat();
}
/**
* Default constructor - suppressed because this class cannot be
* instantiated
*/
private Numbers() {
throw new AssertionError("this class cannot be instantiated");
}
}
NumbersTest.java
- Code:
/*
Copyright (C) 2013 Justin Hanekom <justin.hanekom@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package ca.kjmj.lang;
import org.junit.Assert;
import org.junit.Test;
public class NumbersTest {
@Test(expected = IllegalAccessException.class)
public void testCannotCreateANumbersInstance()
throws IllegalAccessException, InstantiationException,
ClassNotFoundException {
Class.forName("ca.kjmj.lang.Numbers").newInstance();
}
@Test
public void testCreatesADefaultDecimalFormat() {
Assert.assertNotNull(
"Numbers.createDefaultDecimalFormat() returned null. "
+ "It should return a DecimalFormat instance",
Numbers.createDefaultDecimalFormat());
}
@Test
public void testEachDefaultDecimalFormatIsANewInstance() {
Assert.assertNotSame(
"Numbers.createDefaultDecimalFormat() returned the same "
+ "instance. Each call should return a unique instance",
Numbers.createDefaultDecimalFormat(),
Numbers.createDefaultDecimalFormat());
}
}
30 posts
• Page 2 of 2 • 1, 2
Return to Python Challenge Hints
Who is online
Users browsing this forum: No registered users and 1 guest
