Advertisement
Vitaliy_Novichikhin

2.18.5 ЯП верно решено, почему false сам переводит на else?

Feb 3rd, 2022
1,959
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. import pandas
  2. realty_df = pandas.read_csv('yandex_realty_data.csv')
  3.  
  4. index = 3  # проверим другой объект
  5.  
  6. # замените print() конструкцией if-else
  7. if (realty_df['floor'][index] == 1 and
  8.     realty_df['area'][index] >= 40 and
  9.     realty_df['price'][index] <= 190000 and
  10.     realty_df['commercial_type'][index] in ['FREE_PURPOSE', 'RETAIL'] and
  11.     realty_df['distance'][index] <= 6.7 and
  12.     realty_df['already_taken'][index] == 0 and
  13.     realty_df['competitors'][index] <= 1) in [True or False]:
  14.     print('Объект подходит')
  15. else:
  16.     print('Объект не подходит')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement