2

I know there's input() which stores the entire input into a variable and I can just use regex from it, but what I want is a quick function that look for a specific pattern in the input, match it and store it into a variable.

For example, in C to store just the day,month and year from an input:

printf("Type your birthday (dd/mm/yyyy):\n")
scanf("%d/%d/%d", &d,&m,&y)    // <---

Is there something equivalent in Python?

tadm123
  • 8,294
  • 7
  • 28
  • 44

0 Answers0