zoukankan      html  css  js  c++  java
  • Lambda实现if...elif...else【三元表达式】

    fun3= lambda x: print('A',x) if x<10 else (print('B',x) if x==10 else print('C',x))
    
    fun3(11)
    
    
    if not float(first_list[rank_to_compare]):
        increase_or_decrease = float(second_list[rank_to_compare])/float(first_list[rank_to_compare])-1
        second_list[rank_to_add_flag] = increase_flag + second_list[rank_to_add_flag] 
            if increase_or_decrease > threshold else (decrease_flag + second_list[rank_to_add_flag]
            if increase_or_decrease < -threshold else second_list[rank_to_add_flag])
    
  • 相关阅读:
    day20
    day19
    day18
    day17
    day16
    day14 HTML
    day7课程
    day6
    python-day4
    python-day3
  • 原文地址:https://www.cnblogs.com/amize/p/14821879.html
Copyright © 2011-2022 走看看