5 Ways of Taking Input in Python

To use Python in competitive programming, you will have to know how to take input from stdin.


This is a companion discussion topic for the original entry at https://toph.co/tutorials/5-ways-taking-input-python

in the first line, there is only 3, only one input… this is creating problem in my code, how can I ignore that ?

my code is like, a, b = map(int, input().split())

is there any way leave b in blank here ? or I am writing the code in the wrong way :frowning:

help me out, @hjr265

1 Like

Can you give me an example of what the input looks like?

in c i saw people write ----->>>

int a,b,c;
scanf("%d%d%d",&a,&b,&c);
...

how can write this in python??

Hey @imran.py, welcome to Toph.

I am sorry I didn’t notice your post earlier. You can do something like this in Python 3:

a, b, c = map(int, input().split())