PW Akshay

Generation

generate functionMon, 28 Nov 2022

print(string.ascii_letters + string.digits + string.punctuation) # write string at once in above code

""" """ ''' ''' # String concatenation a = 'hello' b = 'world' c = a + b print(c) a = 'hello' b = 'world' c = a + ' ' + b print(c) # String casting a = 10 b = '20' c = a + int(b) print(c) # Specify data type a = 10 b = '20' c = a + int(b) print(type(c)) print(c) # Format a = 10 b = '20' c = '{0} + {1} = {2}'.format(a, b, a + int(b)) print(c)

Questions about programming?Chat with your personal AI assistant