make input for x11, x12, x13, b1 (int) in one line in python

You can make input for x11, x12, x13, and b1 in one line in Python by using the input function with a list comprehension and map to convert the input values to integers. Here's how you can do it:

main.py
x11, x12, x13, b1 = map(int, input("Enter x11, x12, x13, b1: ").split())
73 chars
2 lines

This code will prompt the user to enter values for x11, x12, x13, and b1 in a single line separated by spaces, and then assign those values to the variables x11, x12, x13, and b1 respectively as integers.

related categories

gistlibby LogSnag