[Tutor] Help Passing Variables

David Hutto dwightdhutto at gmail.com
Thu Oct 18 10:12:54 CEST 2012


#This is the actual code:

def SwapCaseAndCenter(a_string, upper_or_lower = None):

	if upper_or_lower == "upper":
		print a_string.center(center_num).upper()

	if upper_or_lower == "lower":
		print a_string.center(center_num).lower()

a_string = raw_input("Give me a word, or letter: ")
upper_or_lower = raw_input("upper, or lower character(s): ")
center_num = int(raw_input("Where should number be centered?: "))
SwapCaseAndCenter(a_string, upper_or_lower)


-- 
Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com


More information about the Tutor mailing list