Demonstrates creating new strings with a for loop,,message = ra
Demonstrates creating new strings with a for loop,,message = ra
message = raw_input('Enter a message: ')new_message = ''VOWELS = 'aeiou'printfor letter in message: if letter.lower() not in VOWELS: new_message += letter print 'A new string has been created:', new_messageprint '\nYour message without vowels is:', new_message
- Assignment to slices: Replace some items,assignmentsli
- Define and call a function inside another function,def
- Tuple indexing and slicing,tupleslicing,T = (1, 2, 3
- Filter demo: lambda function inside,filterlambda,foo =
- Handle File reading Exception,handlereading,import sys
- Create a base class for exceptions defined by a module,
热门文章:
相关内容
- Assignment to slices: Replace some items,assignmentslices,a = ['spa
- Define and call a function inside another function,defineinside,def
- Tuple indexing and slicing,tupleslicing,T = (1, 2, 3
- Filter demo: lambda function inside,filterlambda,foo = [2, 18
- Handle File reading Exception,handlereading,import systr
- Create a base class for exceptions defined by a module,exceptionsde
- Assign list to a list item,assignitem,L = ['Alread
- String literals span multiple lines in several ways.,literalsmultip
- A Simple function definition: return a tuple.,definitiontuple,def q
- Generic access to DBM-style databases,dbm-styledatabases,import fil
评论关闭