- Upvotes Received
- 2
- Posts with Upvotes
- 1
- Upvoting Members
- 2
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
7 Posted Topics
Hi, I was working on a solution to problem ten of Project Euler, which states: > The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. > Find the sum of all the primes below two million. I've got code that solves this …
No, not at all. Here's the modfied code that fixes this: def main(): first_Name = "s u p e r n a t u r a l" + " " for i in range(0,len(first_Name)+2, 2): print(first_Name[i:] + first_Name[:i]) main() Basicly, you forgot about that range loops though all the numbers …
If you're completely new to programming, I would also recommend Codecademy, best descried as an online interactive classroom. It starts off holding your hand, and releases it slowly; ideal for beginners.
Hey, I tryed the first problem of the Euler project, but for some reason the code bellow is not give me the correct answer: def multiple_sum(multiple=3): x = 0 for n in range(0, 1000): if not (n % multiple): x += n return x print multiple_sum(5) + multiple_sum(3) It is …
The way you're formated this makes it hard to read, esps specailly to a reletivly new hobbyist programmer like me; this needs to change ASAP. You're also trying to distribute a switch across mutiple functions, whtch is a total no-no. The rest of it: Jesus.
I getting an error when I try to run this function here: def get_char_out(prompt=None): while True: try: return str(raw_input(prompt + ' ')) break except ValueError: print '\nInvaild input' print get_char_out('String, please') I keep getting this error here: String, please Traceback (most recent call last): File "main.py", line 11, in get_char_out('String, …
`print 'Hello world'` Hi all. I am Brett Warren of the UK, a school student learning to program in C++ and Python in my spare time. I look forward to getting to know this place, as first impressions are extremely positive.
The End.