Posts

Showing posts from August, 2013

convert a number from other base to integer

I have been using the int() function for converting string representation of a number to it's numeric value. For example: number = int('1050') But today I just come to know that there is an optional second argument in the int function. It will help you convert any number from base 2 to 36 into base 10. Few examples are given below: >>> int('xyz', 36) 44027 >>> int('ff', 16) 255 >>> int('FF', 16) 255 >>> int('f', 16) 15 >>> int('10', 2) 2 >>> int('10') 10 >>> int('10', 10) 10 Python is simple!

Online Python Programming Course

Python appears to be the preferred language to teach programming now days, at least in most of the introductory computer programming courses in MOOCs. Here I give you a short list of courses if you want to start learning programming (or if you want to recommend someone else, as if you read this blog, chance is you are already a programmer!). :) Introduction to Computer Science " At the end of this course, you will have learned key concepts in computer science and enough programming to be able to write Python programs to solve problems on your own. This course will prepare you to move on to intermediate-level computing courses. " Learn to Program: The Fundamentals "This course introduces the fundamental building blocks of programming and teaches you how to write fun and useful programs using the Python language." An Introduction to Interactive Programming in Python "This course is designed to be a fun introduction to the basics of programming in Python.