I've got this code which outputs a print of user inputted terms to console
x = input("Input x: ")
y = input("Input y: ")
z = input("Input z: ")
xS = x.split(", ")
yS = y.split(", ")
zS = z.split(", ")
[print('"{}"'.format(i), end=" ") for i in xS] + [print('"{}"'.format(i), end=" ") for i in yS] + [print('-"{}"'.format(i), end=" ") for i in zS]
where the inputs can be like he, haha, ho ho, he he he
,
and the print function outputs like so when x = he
, y = haha, ho ho
, and z = he he he
"he" "haha" "ho ho" -"he he he"
Does anyone know a way to assign the output of the print ("he" "haha" "ho ho" -"he he he"
) to a variable like j
?
CLARIFICATION EDIT: the double quotes in the print output aren't saying that its a string. This whole thing is basically taking in user input, splitting it up with ,
as a delimiter, and adding the ""
to the start and end of each separated term which end up as "term"
, that finally gets put into a search engine that works similar to Google's