+ 1

How can I take more than one input in one line in python?

4th Apr 2020, 8:04 PM
SĪ¹ŹŃ”Õ¼ŹĪ± Ɉą¹Õ¼Ī±Č¶É¦Ī±Õ¼ Eną¹ch
SĪ¹ŹŃ”Õ¼ŹĪ± Ɉą¹Õ¼Ī±Č¶É¦Ī±Õ¼ Eną¹ch - avatar
2 Answers
+ 2
By using list list_of_inputs = input().split() # separate by whitespace list_of_inputs = input().split(',') # separate by comma list_of_inputs = input().split('-') # separate by minus sign
4th Apr 2020, 8:12 PM
Azi šŸ‡ŗšŸ‡æ
+ 2
as Azi...or you can unpack the input in variables..example... this unpacks a spaces-separated phrase in to three variables and disregards the other words...just amend to suit your needs.. a, b, c, *_ = input().split() print(a) print(b) print(c)
4th Apr 2020, 8:46 PM
rodwynnejones
rodwynnejones - avatar