Answer the question
In order to leave comments, you need to log in
How do you define three variables in one line?
How to write three words in one line, separated by a space, that they were designated as the values of three variables? For example, Apple Tomato Lemon , the value of the first variable is Apple , the value of the second variable is Tomato , the value of the third variable is Lemon .
Answer the question
In order to leave comments, you need to log in
s = raw_input('Enter 3 words')
word1, word2, word3 = (s.split() + [''] * 3)[:3]
print word3, word2, word1
a,b,c = Apple,Tomato,Lemon
or
a = "Apple Tomato Lemon"
a[0] = Apple
a[2] = Tomato
a[4] = Lemon
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question