Let's code a beginner's Python SLOT MACHINE 🎰

  Рет қаралды 31,268

Bro Code

Bro Code

Күн бұрын

Пікірлер: 86
@BroCodez
@BroCodez 6 ай бұрын
# Python Slot Machine import random def spin_row(): symbols = ['🍒', '🍉', '🍋', '🔔', '⭐'] return [random.choice(symbols) for _ in range(3)] def print_row(row): print("**************") print(" | ".join(row)) print("**************") def get_payout(row, bet): if row[0] == row[1] == row[2]: if row[0] == '🍒': return bet * 3 elif row[0] == '🍉': return bet * 4 elif row[0] == '🍋': return bet * 5 elif row[0] == '🔔': return bet * 10 elif row[0] == '⭐': return bet * 20 return 0 def main(): balance = 100 print("*************************") print("Welcome to Python Slots ") print("Symbols: 🍒 🍉 🍋 🔔 ⭐") print("*************************") while balance > 0: print(f"Current balance: ${balance}") bet = input("Place your bet amount: ") if not bet.isdigit(): print("Please enter a valid number") continue bet = int(bet) if bet > balance: print("Insufficient funds") continue if bet 0: print(f"You won ${payout}") else: print("Sorry you lost this round") balance += payout play_again = input("Do you want to spin again? (Y/N): ").upper() if play_again != 'Y': break print("*******************************************") print(f"Game over! Your final balance is ${balance}") print("*******************************************") if ___name___ == '__main__': main()
@MC_Transport
@MC_Transport 6 ай бұрын
Is Bro Code your real name
@NerkoVukovic
@NerkoVukovic 6 ай бұрын
line 80, in if _name_ == '__main__': NameError: name '_name_' is not defined. Did you mean: '__name__'?
@MedakitOwO
@MedakitOwO 6 ай бұрын
​@@MC_Transportlol it's not it's just an internet alias
@MedakitOwO
@MedakitOwO 6 ай бұрын
​@@NerkoVukovicjust do '__name__' whenever that happens just follow the error code
@user-ze5vx6vf3n
@user-ze5vx6vf3n 6 ай бұрын
how to repeat input("Do you want to spin again? (Y/N): ").upper() if that is not alpha or not y and n
@towsifbillah834
@towsifbillah834 6 ай бұрын
bro is brother, bro is helper , bro is savior, bro is teacher, bro is legend . Love you bro
@cantbeserious4120
@cantbeserious4120 16 күн бұрын
Thanks Bro. You’re a huge help. I gotta say your videos have to be the easiest to follow and your organization is impeccable.
@paraglide01
@paraglide01 6 ай бұрын
Thanks man, projects really help me speed up my learning proces.
@cruyffsworld9731
@cruyffsworld9731 6 ай бұрын
Simply the best channel in youtube . straight to the point and no one doesnt understand him .
@motomadman573
@motomadman573 6 ай бұрын
Not only did i learn more about coding, i got a free lesson on why not to gamble 😀
@kapibara2440
@kapibara2440 5 ай бұрын
Had the same thought 😊
@alan-overthenet
@alan-overthenet 6 ай бұрын
Bro, I really enjoyed this, thank you. I learn and retain by doing projects like this. You are a gem
@TheCommunistRabbit
@TheCommunistRabbit 6 ай бұрын
99% of programmers quit before hitting the subscribe button
@b.ka7med114
@b.ka7med114 6 ай бұрын
LET GO GAMBLING **strange sound** oh dang it **strange sound** oh dang it **strange sound** oh dang it **strange sound** oh dang it
@PersonalEmail-ot1bq
@PersonalEmail-ot1bq 5 ай бұрын
😂😂
@dmays67
@dmays67 6 ай бұрын
Much easier to follow for this newbie. Looking forward to coding myself and maybe looking for improvements. Especially loved the use of emojies - it's the pretty colors and noises that keep the punters coming back!
@sreedarshinikannan467
@sreedarshinikannan467 6 ай бұрын
Love all your videos !!! Could you also do tutorials for Flutter pls . Thanks
@dariuss.4274
@dariuss.4274 6 ай бұрын
thank you for your tutorials I love your videos
@HacknCodeOffical
@HacknCodeOffical 6 ай бұрын
Bro code is my 3rd most favourite coding teacher on entire KZbin ❤️🔥🗿
@spenceragain
@spenceragain 6 ай бұрын
Who are the other two?
@HacknCodeOffical
@HacknCodeOffical 6 ай бұрын
@@spenceragain 1st code with Harry 2nd the code mentor
@kingshahzad78
@kingshahzad78 3 ай бұрын
Wowwww.... What a wonderful way of importing fruits 👌👌
@Stace-os6iq
@Stace-os6iq 6 ай бұрын
I love all your work thank you❤️❤️❤️
@zenogaylord7869
@zenogaylord7869 6 ай бұрын
Bro when are you live on twitch I need to sub to you as a thank you for all these amazing free lessons
@InnnocentladSMCtradinghub
@InnnocentladSMCtradinghub 6 ай бұрын
Sit back relax and enjoy
@shricharanramesh7149
@shricharanramesh7149 5 ай бұрын
I recreated this program by myself. Thanks bro for this amazing video import random def create_row(): return [random.choice(['🍒', '🍉', '🍊', '🔔', '⭐']) for _ in range(3)] def print_row(row): print(" ***************") print(f" {row[0]} | {row[1]} | {row[2]} ") print("*************** ") def bet(balance): amount = int(input("Enter the amount to bet : ")) if amount > balance: print("Insufficient funds") elif amount < 0: print("Amount cannot be negative.") else: return amount return -1 def pay(row, bet_amount): if row[0] == row[1] == row[2]: print("You Won!") amount_earned = 0 if row[0] == '🍒': amount_earned = 3 * bet_amount elif row[0] == '🍉': amount_earned = 4 * bet_amount elif row[0] == '🍊': amount_earned = 5 * bet_amount elif row[0] == '🔔': amount_earned = 10 * bet_amount elif row[0] == '⭐': amount_earned = 20 * bet_amount else: amount_earned = 0 print(f"Amount Earned : ₹{amount_earned}") return amount_earned else: print("You Lose!") return 0 def main(): print("-------------------------") print(" Slot Machine ") print("-------------------------") balance = 1000 running = True while running and balance > 0: print(f"Your balance : ₹{balance}") spin = input("Do you want to spin? (y/n): ") if not spin == 'y': running = False continue bet_amount = bet(balance) if bet_amount == -1: continue else: balance -= bet_amount row = create_row() print_row(row) balance += pay(row, bet_amount) print("Thanks for playing! We looted all your money :)") if __name__ == '__main__': main()
@GayatriMagapu
@GayatriMagapu Ай бұрын
Purpose of return -1 please...?? Actually why did you used in the code
@kingshahzad78
@kingshahzad78 3 ай бұрын
Excellent Job Sir❤❤❤❤
@JassersChannel
@JassersChannel 5 ай бұрын
Bro almost became a gambling addict
@paraglide01
@paraglide01 6 ай бұрын
Can you show how to do the shortcuts like for random module at 9:00 please.
@CrispyandCalmm
@CrispyandCalmm 6 ай бұрын
Thanks Bro Free Education
@enemdes3735
@enemdes3735 6 ай бұрын
This was so fun thanks for video 😂👍
@cruyffsworld9731
@cruyffsworld9731 6 ай бұрын
Can u explain algorithms and data structure in python , because ur explanations are the best .
@siciliandragon8654
@siciliandragon8654 3 ай бұрын
Just say bet = int(input("Place your bet amount: ) so you don't have to take the extra step and convert the string.
@nishawnbeckford2636
@nishawnbeckford2636 6 ай бұрын
Awesome vid
@GamerDevIND
@GamerDevIND 6 ай бұрын
Bro is back to python 😊
@dysoneducation
@dysoneducation Ай бұрын
Bro is a genius 🧠🧠🧠👏 thank you
@RajaPatel-h3t
@RajaPatel-h3t 6 ай бұрын
Bro make videos on express js , node js
@3minutesbibletruth
@3minutesbibletruth 6 ай бұрын
Thank you boss its been a while I guess I have missed a lot
@exactmidnight
@exactmidnight 6 ай бұрын
Cool blud keep winning love ya
@technicalswag3925
@technicalswag3925 6 ай бұрын
Sir please continue and complete the react course
@NightMare-hi7vu
@NightMare-hi7vu 6 ай бұрын
Bro please make an updated version of the python full course just like the js one
@AukeiHD
@AukeiHD 6 ай бұрын
hey i really love your videos, I was wondering if you could make a video about "matlab".
@Jordan-qi2dn
@Jordan-qi2dn 6 ай бұрын
Hey Bro, would you be able to do an updated video of C#? And when are you streaming again?!
@Bumblevie_
@Bumblevie_ 6 ай бұрын
thanks bro code
@3minutesbibletruth
@3minutesbibletruth 6 ай бұрын
I wish I had someone I could count on in life. I have studied beyond just web design but I'm not getting simple freelance gigs to do. Sometimes I ask myself that is it because I don't have a certificate.
@gordon2161
@gordon2161 6 ай бұрын
Is this going in the 12 Hour course?
@olivergrim7634
@olivergrim7634 6 ай бұрын
its already out several years ago, it will not get added
@bjrn-magnekristensen2444
@bjrn-magnekristensen2444 6 ай бұрын
ai this gave me insperation want to try it in c, thanks bigbro
@eifclub978
@eifclub978 6 ай бұрын
bro already sound like gigachad
@osmanldevleti4858
@osmanldevleti4858 6 ай бұрын
It would be nice if you make a Mongoose video series.
@chetranshlasod5157
@chetranshlasod5157 6 ай бұрын
@BroCodez do data structures in panda pleasee love ur vids ..... 🙌
@jordankerr1
@jordankerr1 6 ай бұрын
Can you do ISpalindrome method/reverse string in c#?
@s.p_akash
@s.p_akash 6 ай бұрын
Broo can you make a video about Regular Expressions in Python
@naveenshankar-jk2vd
@naveenshankar-jk2vd 6 ай бұрын
Try to.make videos for node js bro it is a upcoming source library
@S.h.a.d.o.w.S.c.r.i.p.t.e.r
@S.h.a.d.o.w.S.c.r.i.p.t.e.r 6 ай бұрын
Bro Please Explain Django and Flask
@ranz1040
@ranz1040 6 ай бұрын
Make a go language Playlist please
@jadotati7641
@jadotati7641 6 ай бұрын
Make an assembly course🙂!
@mdyusufansari8897
@mdyusufansari8897 6 ай бұрын
can we add these project in our cv
@melkor1177
@melkor1177 6 ай бұрын
we need a kotlin tutorial
@ideology8323
@ideology8323 6 ай бұрын
My bro, help me understand the express node js module!
@iDebashish
@iDebashish 6 ай бұрын
Please Bro do a full course of Kotlin.
@Yuji_07
@Yuji_07 6 ай бұрын
like if u want more react tutorial
@ChickenNoodleSandwich
@ChickenNoodleSandwich 6 ай бұрын
GAMBLEING YEAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
@3minutesbibletruth
@3minutesbibletruth 6 ай бұрын
My laptop spoilt so I was not able to follow up with the good content and build my carrier
@roelroel2k3
@roelroel2k3 6 ай бұрын
i copied everything but theres a bug in line 49, 45, 8 I'm using python 3.9.6
@3minutesbibletruth
@3minutesbibletruth 6 ай бұрын
Nothing seems to be working for me. I'm frustrated in life cuz after all nobody got my back. I have given up my best for this carrier but still.
@VAIBHAVRAGHAV-g6y
@VAIBHAVRAGHAV-g6y 6 ай бұрын
Relax buddy
@RealSyLol
@RealSyLol 6 ай бұрын
pls type hinting 4 python
@3minutesbibletruth
@3minutesbibletruth 6 ай бұрын
Nothing seems to be working for me. The part of the world I find myself is very tough.
@moegreene3630
@moegreene3630 6 ай бұрын
You know, only a real Chad would teach people how to code in several languages and end the series by teaching us assembly. Just saying. Throw back languages would be pretty dope. I hear COBOL still has business because of the U.S. banking system and military.
@KingXJulien
@KingXJulien 6 ай бұрын
Kotlin please
@3minutesbibletruth
@3minutesbibletruth 6 ай бұрын
I need help guys if you can help me in any way to get me a job or get a new laptop for me please I would appreciate. Cuz at this moment only hope is my portion
@manavmehta9395
@manavmehta9395 6 ай бұрын
hey, results = [] for symbols in range (3): results.append(random.choice(symbols)) return results this code that you showed as an option outputs object error.
@RayTheBos
@RayTheBos 6 ай бұрын
Bro Code pls do C++ full course with Unreal Engine (making a game)
@spaghetticat110
@spaghetticat110 6 ай бұрын
Gamblemaxxing
@Lynx_YTOFF
@Lynx_YTOFF 6 ай бұрын
🫡🫡🫡🫡🫡🗿
@crystallinnen5600
@crystallinnen5600 6 ай бұрын
__name__
Let's code a HANGMAN GAME in Python! 🕺
25:07
Bro Code
Рет қаралды 21 М.
Python 50 Useful Tips
41:59
DataScience&Coding José Comé
Рет қаралды 6 М.
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
40 String methods in Python with examples | Amit Thinks
34:12
Amit Thinks
Рет қаралды 41 М.
5 Good Python Habits
17:35
Indently
Рет қаралды 661 М.
Let's code a beginner Python BANKING PROGRAM 💰
15:01
Bro Code
Рет қаралды 304 М.
Python CLASS VARIABLES explained easy! 🎓
8:16
Bro Code
Рет қаралды 12 М.
Learn Python Object Oriented Programming! 🚗
12:18
Bro Code
Рет қаралды 33 М.
10 Python Comprehensions You SHOULD Be Using
21:35
Tech With Tim
Рет қаралды 162 М.
10 Important Python Concepts In 20 Minutes
18:49
Indently
Рет қаралды 377 М.
Python Tutorial for Beginners (with mini-projects)
8:41:54
freeCodeCamp.org
Рет қаралды 708 М.
Python 101: Learn the 5 Must-Know Concepts
20:00
Tech With Tim
Рет қаралды 1,2 МЛН
3 PYTHON AUTOMATION PROJECTS FOR BEGINNERS
17:00
Internet Made Coder
Рет қаралды 1,7 МЛН