15 Days of Python: Day-2
Number and Strings In this blog I am going to discuss about Numbers and Strings. First jump to numbers. NUMBERS: 1. Arithmetic Operations -- we can simply perform addition,multiplication, division and modulo operations on numbers. example: > 1+2=3 > 2*2 = 4 > 5/2 = 2.5 (float division) > 5//2 = 2 (integer division) > 10%3 = 1(remainder) 2. Assignment Operation -- example: > width = 20 > height = 30 > area = width*height > print(area) >> 600 So there are nothing much to do with numbers.You can just simply perform normal mathmatical operations on it. STRING: 1. Normal printing of strings -- >>> 'spam eggs' # single quotes 'spam eggs' >>> 'doesn \' t' # use \' to escape the single quote... "doesn't" >>> &quo