Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
getting inputs efficiently
#1
Is is posssible to get several inputs at once in 1 request, not 1 by 1 in series of input requests. For example: how to get the input of name and age not sequentially asking first name input and then age, but in the same input request get 2 inputs at once ? thanks in advance!
Reply
#2
Have a look at the split method
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags


Reply
#3
Use
input1 = input()
spit_input = [x for x in input1.split(" ")]
The split allows the input to be sentence, or separated by spaces
pyzyx3qwerty
"The greatest glory in living lies not in never falling, but in rising every time we fall." - Nelson Mandela
Need help on the forum? Visit help @ python forum
For learning more and more about python, visit Python docs
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to read in mulitple files efficiently garynewport 3 845 Jan-27-2023, 10:44 AM
Last Post: DeaD_EyE
  How to efficiently average same entries of lists in a list xquad 5 2,070 Dec-17-2021, 04:44 PM
Last Post: xquad
  Finding a Hamiltonian Path Efficiently - ADVANCED stauffski 3 5,885 Dec-31-2019, 10:25 PM
Last Post: stauffski

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020