• 20201224-1


    1-1
    #
    bicycles.py bicycles = ['trek', 'cannondale', 'redline', 'specialized'] message = "My first bicycle was a " + bicycles[0].title() + "." print(message)
    --->
    My first bicycle was a Trek.
    1-2
    # cars.py
    
    cars = ['bmw', 'audi', 'toyota', 'subaru']
    
    print("Here is the original list:")
    print(cars)
    
    print("
    Here is the sorted list:")
    print(sorted(cars))
    
    print("
    Here is the reverse alphabetical list:")
    print(sorted(cars, reverse=True))
    
    print("
    Here is the original list again:")
    print(cars)
    1-3
    # motorcycles
    motorcycles = ['honda', 'yamaha', 'suzuki', 'ducati'] 
    print(motorcycles)
    
    too_expensive = 'ducati'
    motorcycles.remove(too_expensive)
    print(motorcycles)
    print("
    A " + too_expensive.title() + " is too expensive for me.")

    注:知识点链接 

    https://www.cnblogs.com/azxsdcv/p/14183819.html

    https://www.cnblogs.com/azxsdcv/p/14183874.html

  • 相关阅读:
    pandas取值
    pandas 基本操作
    Pandas三个数据结构
    pandas.Series
    scipy线性模块liner(linalg)
    numpy meshgrid函数
    scipy插值interpolation
    scipy优化器optimizer
    scipy积分 integral
    8086汇编 Loop 指令
  • 原文地址:https://www.cnblogs.com/azxsdcv/p/14183765.html
Copyright © 2020-2023  润新知