String Formatting with Dictionaries,,phonebook =
String Formatting with Dictionaries,,phonebook =
phonebook = {'A': '777-7777', 'B': '222-2222', 'C': '333-3333'}print 'C's phone number is %(C)s.' % phonebook
- Demonstrates the for loop with a string,demonstrateslo
- String method: to upper case,methodupper,quote = 'Pyt
- Escape Codes: \b, \t, \n, \a, \r,escapecodes,s = 'e:\\
- Escape characters: \n and \t,escapecharacters,s = 'a\n
- Find substring in a string,substringstring,S = 'xxxxSP
- Indices may be negative numbers, to start counting from
热门文章:
相关内容
- Demonstrates the for loop with a string,demonstratesloop,word = raw
- String method: to upper case,methodupper,quote = 'Pyt
- Escape Codes: \b, \t, \n, \a, \r,escapecodes,s = 'e:\\Beg
- Escape characters: \n and \t,escapecharacters,s = 'a\nb\tc
- Find substring in a string,substringstring,S = 'xxxxSPA
- Indices may be negative numbers, to start counting from the right. Fo
- Joining strings,joiningstrings,list1 = [ '
- Splitting a String,splittingstring,li = ['serve
- Output and get length of a string with special characters,outputcha
- Use r to define a string and return its length,definelength,path =
评论关闭