Jun-23-2019, 03:54 PM
(Jun-23-2019, 02:38 PM)ichabod801 Wrote:height = input('What is your height, {}? '.format(name)) # 56 characters height = input(f'What is your height, {name}? ') # 48 characters height = input('What is your height ' + name + ' ') # 52 charactersf-strings are the easy way. Note that adding another variable to this would add 2 characters plus the variable name to the format and f-string techniques, and 8 characters (4 spaces, 2 plusses, 2 quotes) to the addition technique. So in general, format will be easier than addition as well. And depending on implementation, addition can be less efficient.
now i understand you have really helped me i used the last one and it worked out. Note that I just started learning, and i appreciate the help.