I have a tuple list of university names and I'm trying to get it to store each university name as a string in a list. I have tried the following code. Any thoughts on how to achieve this?
def convertTuple(tup):
str = ''
for item in tup:
str = str + item
return str
main():
school = convertTuple(schoolName)
print(school)
schoolName = [('Carthage',), ('Clarkson',), ('F&M',), ('GMU',), ('Georgia_Tech',), ('IIT',), ('Kenyon',), ('MIT',), ('McDaniel',), ('Michigan_State',), ('NIU',), ('Oklahoma_State',), ('Penn_State',), ('Princeton',), ('Purdue',), ('Radford',), ('Ramapo',), ('Randolph_Macon',), ('Rowan',), ('Tarleton',), ('TCU',), ('Texas_State',), ('Tulane',), ('UMASS_Lowell',), ('University_Of_Alabama',), ('UC_Berkeley',), ('UC_Riverside',), ('Maine',), ('UMBC',), ('UNO',), ('South_Alabama',), ('South_Carolina',), ('UT_Austin',), ('Toronto',), ('University_Of_Washington',), ('Ursinus',), ('Washington_State',), ('Wisconsin',)]
main():supposed to bedef main():? Where do you call it? The indentation is messed up.stras a variable name. It shadows the built-instrclass.