Close Menu
    Trending
    • Future of Business Analytics in This Evolution of AI | by Advait Dharmadhikari | Jun, 2025
    • You’re Only Three Weeks Away From Reaching International Clients, Partners, and Customers
    • How Brain-Computer Interfaces Are Changing the Game | by Rahul Mishra | Coding Nexus | Jun, 2025
    • How Diverse Leadership Gives You a Big Competitive Advantage
    • Making Sense of Metrics in Recommender Systems | by George Perakis | Jun, 2025
    • AMD Announces New GPUs, Development Platform, Rack Scale Architecture
    • The Hidden Risk That Crashes Startups — Even the Profitable Ones
    • Systematic Hedging Of An Equity Portfolio With Short-Selling Strategies Based On The VIX | by Domenico D’Errico | Jun, 2025
    Finance StarGate
    • Home
    • Artificial Intelligence
    • AI Technology
    • Data Science
    • Machine Learning
    • Finance
    • Passive Income
    Finance StarGate
    Home»Machine Learning»Introduction to Python. Code is a set of instructions to do… | by 桜満 集 | Feb, 2025
    Machine Learning

    Introduction to Python. Code is a set of instructions to do… | by 桜満 集 | Feb, 2025

    FinanceStarGateBy FinanceStarGateFebruary 17, 2025No Comments2 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
    Share
    Facebook Twitter LinkedIn Pinterest Email


    Code is a set of directions to do one thing particular, given to a pc.

    Variables are labels to containers of saved data

    Python Objects have worth and kind.

    Easy object sort consists of String, Integer, Float, Boolean and NoneType.

    Use the kind(object) operate to know the kind of object.

    # string

    a = “abc”

    #

    print(sort(a))

    # Integer

    a = 1

    #

    print(sort(a))

    # Float

    a = 1.0

    #

    print(sort(a))

    # Boolean (True or False)

    a = True

    #

    print(sort(a))

    # NoneType

    a = None

    #

    print(sort(a))

    Compound sorts are listing, tuple and dictionary.

    # listing

    a = [1, “pizza”]

    #

    print(sort(a))

    # tuple

    a = (1, ”pizza”)

    #

    print(sort(a))

    # dictionary

    a = { “a”: 1, “1”: [2]}

    #

    print(sort(a))

    # Record

    numbers = [“one”, “two”, “three”]

    # one

    print(numbers[0])

    # three

    print(numbers[-1])

    numbers.append(“4”)

    # 4

    print(numbers[-1])

    numbers[-1] = “5”

    print(numbers) # [“one”, “two”, “three”, “five”]

    # Tuple

    numbers_2 = (“one”, “two”, “three”)

    # one

    print(numbers_2[0])

    # three

    print(numbers_2[-1])

    # tuple is immutable. we couldn’t change it.

    numbers_2 = (“one”, “two”, “three”, “5”)

    print(numbers_2) # (“one”, “two”, “three”, “5”)

    # dictionary

    numbers_3 = {“one”:1, “two”:2, “three”:3}

    # 1

    print(numbers_3[“one”])

    # 3

    print(numbers_3[“three”])

    numbers_3[“four”] = 4

    # {“one”:1, “two”:2, “three”:3, “4”:4}

    print(numbers_3)

    # dict_keys( [ “one”, “two”, “three”, “four”] )

    print(numbers_3.keys())

    # dict_values( [ 1, 2, 3, 4] )

    print(numbers_3.values())

    # dict_items( [ (“one”, 1), (“two”, 2), (“three”, 3), (“four”,4) ] )

    print(numbers_3.gadgets())

    Booleans in Python:

    1)not operator will adverse True to False and False to True.

    not True returns False

    not False returns True

    2)and operator will return True provided that all of the values are True

    True and False returns False

    True and True returns True

    3)or operator will return True if any of the values is True.

    True or False returns True

    False or False returns False

    Comparability operators

    1)== Operator returns True if each values are identical

    3.0 == 3 returns True

    “3” == 3 returns False

    2)!= Operator returns True if each values are totally different

    3.0 != 3 returns False

    “3” != 3 returns True

    3)> operator returns True if worth 1 is greater than worth 2

    3 > 1 returns True

    3 > 10 returns False

    4)

    3

    3

    5) >= operator returns True if worth 1 is larger than or equal to worth 2

    3 >= 3 returns True

    3 >= 2 returns False

    6)

    3

    3

    7) in operator returns True if value1 is in a listing/dictionary/string of values.

    1 in [1,2,3,4] returns True

    10 in “111” returns False

    Conditional statements.

    If A is True, then “A is True” shall be printed.

    If A is False, then “A is False” shall be printed.

    If A is neither True nor False, then “A is unknown” shall be printed.

    if A==True :

    print(“A is True”)

    elif A == False:

    print(“A is False”)

    else:

    print(“A is unknown”)



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleKit Review 2024 | Smart Passive Income
    Next Article How to Get Rapid YouTube Subscriber Growth for Creators
    FinanceStarGate

    Related Posts

    Machine Learning

    Future of Business Analytics in This Evolution of AI | by Advait Dharmadhikari | Jun, 2025

    June 14, 2025
    Machine Learning

    How Brain-Computer Interfaces Are Changing the Game | by Rahul Mishra | Coding Nexus | Jun, 2025

    June 14, 2025
    Machine Learning

    Making Sense of Metrics in Recommender Systems | by George Perakis | Jun, 2025

    June 14, 2025
    Add A Comment

    Comments are closed.

    Top Posts

    How AI Data Labeling Services Facilitate Automated Annotation for Industries in 2025

    April 18, 2025

    Like human brains, large language models reason about diverse data in a general way | MIT News

    February 19, 2025

    How Earth Observation, Spectroscopy, and AI are changing soil use forever and how can we turn soil health research into thriving businesses? Key takeaways from the Soil Health Now! conference 2025 | by OpenGeoHub | May, 2025

    May 18, 2025

    College Majors With the Lowest Unemployment Rates: Report

    May 17, 2025

    6 key lessons in building and enjoying your wealth

    March 27, 2025
    Categories
    • AI Technology
    • Artificial Intelligence
    • Data Science
    • Finance
    • Machine Learning
    • Passive Income
    Most Popular

    Jamie Golombek’s primer on tax brackets, deductions and credits

    April 4, 2025

    How I’ve Made Over $200k With a Unique and Fun Side Hustle

    February 28, 2025

    MIT students’ works redefine human-AI collaboration | MIT News

    February 5, 2025
    Our Picks

    Can AI Be Dangerous? Let’s Talk About It. | by Saroswatroy | Apr, 2025

    April 10, 2025

    Google Uses DolphinGemma AI to Decode Dolphin Communication

    April 29, 2025

    Fueling seamless AI at scale

    May 30, 2025
    Categories
    • AI Technology
    • Artificial Intelligence
    • Data Science
    • Finance
    • Machine Learning
    • Passive Income
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us
    Copyright © 2025 Financestargate.com All Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.