Close Menu
    Trending
    • People are using AI to ‘sit’ with them while they trip on psychedelics
    • Reinforcement Learning in the Age of Modern AI | by @pramodchandrayan | Jul, 2025
    • How This Man Grew His Beverage Side Hustle From $1k a Month to 7 Figures
    • Finding the right tool for the job: Visual Search for 1 Million+ Products | by Elliot Ford | Kingfisher-Technology | Jul, 2025
    • How Smart Entrepreneurs Turn Mid-Year Tax Reviews Into Long-Term Financial Wins
    • Become a Better Data Scientist with These Prompt Engineering Tips and Tricks
    • Meanwhile in Europe: How We Learned to Stop Worrying and Love the AI Angst | by Andreas Maier | Jul, 2025
    • Transform Complexity into Opportunity with Digital Engineering
    AIBS News
    • Home
    • Artificial Intelligence
    • Machine Learning
    • AI Technology
    • Data Science
    • More
      • Technology
      • Business
    AIBS News
    Home»Machine Learning»Python Coding Project:. Building an Interactive Coffee Shop… | by 3milXalton | Dec, 2024
    Machine Learning

    Python Coding Project:. Building an Interactive Coffee Shop… | by 3milXalton | Dec, 2024

    Team_AIBS NewsBy Team_AIBS NewsDecember 27, 2024No Comments1 Min Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
    Share
    Facebook Twitter LinkedIn Pinterest Email


    def coffee_bot():
    print(‘Welcome to the cafe!’)
    measurement = get_size()
    drink_type = get_drink_type()
    print(f”Alright, that’s a {measurement} {drink_type}!”)

    title = enter(“Can I get your title please?n> “)
    print(f”Thanks, {title}! Your drink will likely be prepared shortly.”)

    def get_size():
    res = enter(“What measurement drink can I get for you? n[a] Small n[b] Medium n[c] Massive n> “)

    if res == ‘a’:
    return ‘small’
    elif res == ‘b’:
    return ‘medium’
    elif res == ‘c’:
    return ‘massive’
    else:
    print_message()
    return get_size()

    def print_message():
    print(“I am sorry, I didn’t perceive your choice. Please enter a legitimate possibility.”)

    def get_drink_type():
    res = enter(“What kind of drink would you want? n[a] Brewed Espresso n[b] Mocha n[c] Latte n> “)

    if res == ‘a’:
    return ‘brewed espresso’
    elif res == ‘b’:
    return ‘mocha’
    elif res == ‘c’:
    return order_latte()
    else:
    print_message()
    return get_drink_type()

    def order_latte():
    res = enter(“What sort of milk in your latte? n[a] 2% milk n[b] Non-fat milk n[c] Soy milk n> “)

    if res == ‘a’:
    return ‘latte’
    elif res == ‘b’:
    return ‘non-fat latte’
    elif res == ‘c’:
    return ‘soy latte’
    else:
    print_message()
    return order_latte()

    # Run the espresso bot
    coffee_bot()



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleAI and Data Visualization: Transforming Mental Health Insights
    Next Article Master Bots Before Starting with AI Agents: Simple Steps to Create a Mastodon Bot with Python | by Sarah Lea | Dec, 2024
    Team_AIBS News
    • Website

    Related Posts

    Machine Learning

    Reinforcement Learning in the Age of Modern AI | by @pramodchandrayan | Jul, 2025

    July 1, 2025
    Machine Learning

    Finding the right tool for the job: Visual Search for 1 Million+ Products | by Elliot Ford | Kingfisher-Technology | Jul, 2025

    July 1, 2025
    Machine Learning

    Meanwhile in Europe: How We Learned to Stop Worrying and Love the AI Angst | by Andreas Maier | Jul, 2025

    July 1, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Top Posts

    People are using AI to ‘sit’ with them while they trip on psychedelics

    July 1, 2025

    I Tried Buying a Car Through Amazon: Here Are the Pros, Cons

    December 10, 2024

    Amazon and eBay to pay ‘fair share’ for e-waste recycling

    December 10, 2024

    Artificial Intelligence Concerns & Predictions For 2025

    December 10, 2024

    Barbara Corcoran: Entrepreneurs Must ‘Embrace Change’

    December 10, 2024
    Categories
    • AI Technology
    • Artificial Intelligence
    • Business
    • Data Science
    • Machine Learning
    • Technology
    Most Popular

    How Much Do Google Employees Make? Median Salaries Revealed

    April 28, 2025

    Apple Is Losing $1 Billion a Year on Apple TV+ Streaming

    March 20, 2025

    The Total Derivative: Correcting the Misconception of Backpropagation’s Chain Rule

    May 6, 2025
    Our Picks

    People are using AI to ‘sit’ with them while they trip on psychedelics

    July 1, 2025

    Reinforcement Learning in the Age of Modern AI | by @pramodchandrayan | Jul, 2025

    July 1, 2025

    How This Man Grew His Beverage Side Hustle From $1k a Month to 7 Figures

    July 1, 2025
    Categories
    • AI Technology
    • Artificial Intelligence
    • Business
    • Data Science
    • Machine Learning
    • Technology
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us
    Copyright © 2024 Aibsnews.comAll Rights Reserved.

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