+ 2

How to get three inputs in one statement.

a,b,c=

6th Oct 2017, 12:34 PM
Praveen Kumar
Praveen Kumar - avatar
12 ответов
+ 11
//u can use array for that 👇👇👇 Scanner sc=new Scanner (System.in); int numbers []=new int [3]; for (int x=0;x<3;x++) numbers [x]=sc.nextInt (); //while input these three numbers , leave some space between them //hope it helps☺ (java)
6th Oct 2017, 2:11 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 10
Please elaborate what exactly you want to do? 🐼
6th Oct 2017, 12:40 PM
Apoorva Shenoy Nayak
Apoorva Shenoy Nayak - avatar
+ 10
How about something like this? user_input = raw_input("Enter three numbers separated by commas: ") input_list = user_input.split(',') numbers = [float(x.strip()) for x in input_list] Or, This might prove useful too: a,b=map(int,raw_input().split()) You can then use 'a' and 'b' separately. Source: Stackoverflow.com
6th Oct 2017, 1:17 PM
Apoorva Shenoy Nayak
Apoorva Shenoy Nayak - avatar
+ 4
int a = 10, b = 20, c = 30; Like that?
6th Oct 2017, 12:43 PM
qwerty
qwerty - avatar
+ 3
well that was in java
6th Oct 2017, 12:45 PM
qwerty
qwerty - avatar
+ 2
I want three inputs a=,b=,c= in single statement which means a,b,c=
6th Oct 2017, 12:42 PM
Praveen Kumar
Praveen Kumar - avatar
+ 2
three different inputs in single statement
6th Oct 2017, 12:42 PM
Praveen Kumar
Praveen Kumar - avatar
+ 2
I will work
6th Oct 2017, 12:44 PM
Praveen Kumar
Praveen Kumar - avatar
+ 2
it will work??????
6th Oct 2017, 12:44 PM
Praveen Kumar
Praveen Kumar - avatar
+ 2
I want in python
6th Oct 2017, 12:53 PM
Praveen Kumar
Praveen Kumar - avatar
+ 2
and I want to get input from the user
6th Oct 2017, 12:54 PM
Praveen Kumar
Praveen Kumar - avatar
+ 2
a, b, c = input().split(',')
6th Oct 2017, 5:46 PM
Rishita
Rishita - avatar