Close Menu
    Trending
    • EdgeConneX and Lambda to Build AI Factory Infrastructure in Chicago and Atlanta
    • French streamer’s death ‘not traumatic’, autopsy finds
    • Why Every Entrepreneur Needs an Exit Mindset from Day One
    • Is Reading Dead? Why Gen Z Prefers AI Voices Over Books
    • Beyond KYC: AI-Powered Insurance Onboarding Acceleration
    • Designing a Machine Learning System: Part Five | by Mehrshad Asadi | Aug, 2025
    • Innovations in Artificial Intelligence That Are Changing Agriculture
    • Hundreds of thousands of Grok chats exposed in Google results
    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

    Designing a Machine Learning System: Part Five | by Mehrshad Asadi | Aug, 2025

    August 21, 2025
    Machine Learning

    Mastering Fine-Tuning Foundation Models in Amazon Bedrock: A Comprehensive Guide for Developers and IT Professionals | by Nishant Gupta | Aug, 2025

    August 21, 2025
    Machine Learning

    “How to Build an Additional Income Stream from Your Phone in 21 Days — A Plan You Can Copy” | by Zaczynam Od Zera | Aug, 2025

    August 21, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Top Posts

    EdgeConneX and Lambda to Build AI Factory Infrastructure in Chicago and Atlanta

    August 21, 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

    Simulating Flood Inundation with Python and Elevation Data: A Beginner’s Guide

    May 31, 2025

    Papers Explained 419: The Ladder of Reasoning | by Ritvik Rastogi | Jul, 2025

    July 29, 2025

    Predicting Movie Review Sentiments: A Full-Stack ML Journey | by Satvik Shrivastava | Apr, 2025

    April 9, 2025
    Our Picks

    EdgeConneX and Lambda to Build AI Factory Infrastructure in Chicago and Atlanta

    August 21, 2025

    French streamer’s death ‘not traumatic’, autopsy finds

    August 21, 2025

    Why Every Entrepreneur Needs an Exit Mindset from Day One

    August 21, 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.