Saturday, November 29, 2014

পাইথনে ACM করব কোন ওয়েবসাইটে ?

1. http://www.spoj.com/
2. http://www.codechef.com/

Saturday, November 22, 2014

Easy ACM problem list from UVA

10055 - Hashmat the Brave Warrior
12577 - Hajj-e-Akbar

12478 - Hardest Problem Ever
1124 - Celebrity jeopardy
11172 - Relational Operator

10071 - Back to High School Physics
12250 - Language Detection
12403 - Save Setu
11332 - Summing Digits
12289 - One-Two-Three
10945 - Mother bear


*Written by- Shoayb(IIUC)

Friday, November 14, 2014

Best two Books to Learn Python

Those who are interested to learn Python, you can follow these two books :
 

1. Learn Python The Hard Way. (http://learnpythonthehardway.org/)
2. Dive Into Python. (http://www.diveintopython.net/)

The first one is good for beginners, while the second one is suitable for experienced programmers. Enjoy Python!

Monday, November 10, 2014

Handling automatic newlines in Python

While solving programming contest problems using Python, I came across an issue with the default 'print' function of Python. It adds a newline right after every time it is executed. Example:
Code:
print "Case 1#: "
print "Result"

Output:
Case 1#:
Result
As you can see, this usually has to be done like
Case 1#: Result
Now how do we do this in Python?
Solution:
For Python 2.7:
import sys
sys.stdout.write("Case 1#: ")
sys.stdout.write("Resutl\n")
For Python 3:
print("Case 1#: ", end="")
print("Result")

* Written by- Tafhim Ul Islam