# # print('COMPARE TEXT:') # print("Is 'Anna' == 'anna'?", 'Anna' == 'anna') # print("Is 'bus' < 'busa'?", 'bus' < 'busa') # print("Is 'buss' < 'busar'?", 'buss' < 'busar') # print ("Is 'betar' < 'het'?", 'betar' < 'het') # # # print('\nCONVERT TEXT:') # s='124' # A string # print('String s:', s) # my_list = list(s) # ['1', '2', '4'] but a is still a string # print('s converted to a list:', my_list) # print('But s is unchanged:', s) # x = int(s) #Doesn't work if s='rs124' # print('Convert the string s with numbers to integer:', x) # print("It's now possible to do math operations:'", x/2) # # print('Convert to float:',float(s)) # print('Convert to tuple:',tuple(s)) # NOT tuple(x)TypeError: 'int' object not iterable # print('Convert to list:',list(s)) # # print('\nAll characters have a code, UNICODE (about 1.1 mil.):') # print('A=', ord('A'),' and ', 'a=',ord('a')) #Decimal representation # print('chr(65)=',chr(65)) #decimal repersentation # print('\u0068') #hexadecimal representation # print('\uA9A4') #Javanese # print('I feel \u26A1! I need \u26FE') # print('\N{GOTHIC LETTER OTHAL}') # # # What happens here: # for i in range(26): # print(chr(65+i),'->',chr(97+i),';',end='') # s='Market place 2 am. Bring the money in paper bag.' # coded = '' # for i in range(len(s)): # new_code = ord(s[i])+1 # new_letter = chr(new_code) # coded += new_letter # print(coded, '\n') # # for i in range(26): # print(chr(65+i), '->' ,chr(97+i), ';' ,end='') # print('\n') # #