Jump to content

Сокращение кода в условии


Recommended Posts

Доброго времени суток!

Я столкнулся с такой проблемой, как длинное условие:

if (press) and button=="0" or 
	(press) and button=="1" or
	(press) and button=="2" or
	(press) and button=="3" or
	(press) and button=="4" or
	(press) and button=="5" or
	(press) and button=="6" or
	(press) and button=="7" or
	(press) and button=="8" or
	(press) and button=="9" then

как это можно сократить? числа в диапазоне от 0 до 9 нужно буквально в 1-2 строки записать\\

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...