210-Python - User Input Multiple Variables On 1 Line of Input!

preview_player
Показать описание
Accept multiple inputs on 1 line in python. This is my example of how to.

This is part of a folder (a little library) of small bits of tested code that work. Things like file I/O, interrupts, GPIO definitions, print examples, etc. I don't have to re-invent the wheel every time I write a program. I can go to that folder, copy the pieces I need and be done with my program quickly and with less thrashing.

MATERIALS
- Library folder

PYTHON SOFTWARE LIBRARY (grouped by type and listed in order of difficulty)
001-Python Library of Tips & Tricks

103-Python-File Read

104-Python (Text) File Write

105-Python - Directory File Search & Verify

110-Python-Floating Point Accuracy

120-Python - Format Numbers

130-Python - Simple Print Formatting

140-Python - if, elif, else & CASE?

201-Python - 2D Array Example

202-Python - 3D Array Example

210-Python - Get Multiple Variables With 1 Line of Input!

211-Python - Get Multiple Variables From 1 Lin - Split/Replace Complex

301-Python - Function, Simple

302-Python - Function, Complex

310-Python - Random Numbers (integer & float)

410-Python - Beep Sound

420-Python Music, Simple

430-Python Music, Advanced

500-Python - Graphics, Simple Circle Example

510-Python - Graphics, Line Example

520-Python - Graphics, Sine Wave Example 1

530-Python - Graphics, Sine Wave Example 2

540-Python - Graphics, Tiling / Tiles

550-Python - Graphics, Tic Tac Toe Grid

600-Python - Bubble Sort, Simple

601-Python - Bubble Sort, More Efficient

610-Python - File Sort

701-Python - Bit Shifting (needed for I2C stuff)

710-Python - Recursion
Рекомендации по теме
Комментарии
Автор

wow man...made my life..
Nice one Subscribed...Keep'em comin....

ShinyArjunSingh
Автор

If you have to scan size of an array first and then the array elements...then the below code can help:

n=int(input()) #Press enter to scan all numbers of a particular size n
arr=map(int, input().split()) # This will input numbers in 1 line
l=list(arr)

sgrpnwr
Автор

hey man i want expression taken in input function like
5-4=20 in single input

karthikeyankece
Автор

how can I declare multiple variables without explicitly writing the value of each variable?... ```a, b, c = [1, 2, 3]```

baldeaguirre