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

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

Bro Code

Bro Code

Күн бұрын

Пікірлер: 87
@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 25 күн бұрын
Thanks Bro. You’re a huge help. I gotta say your videos have to be the easiest to follow and your organization is impeccable.
@cruyffsworld9731
@cruyffsworld9731 6 ай бұрын
Simply the best channel in youtube . straight to the point and no one doesnt understand him .
@paraglide01
@paraglide01 6 ай бұрын
Thanks man, projects really help me speed up my learning proces.
@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
@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
@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!
@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 6 ай бұрын
😂😂
@chrisadjei2640
@chrisadjei2640 Күн бұрын
Awesome video. Don't gamble folks 😂
@kingshahzad78
@kingshahzad78 3 ай бұрын
Wowwww.... What a wonderful way of importing fruits 👌👌
@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
@paraglide01
@paraglide01 6 ай бұрын
Can you show how to do the shortcuts like for random module at 9:00 please.
@Stace-os6iq
@Stace-os6iq 6 ай бұрын
I love all your work thank you❤️❤️❤️
@dysoneducation
@dysoneducation Ай бұрын
Bro is a genius 🧠🧠🧠👏 thank you
@kingshahzad78
@kingshahzad78 3 ай бұрын
Excellent Job Sir❤❤❤❤
@InnnocentladSMCtradinghub
@InnnocentladSMCtradinghub 6 ай бұрын
Sit back relax and enjoy
@JassersChannel
@JassersChannel 5 ай бұрын
Bro almost became a gambling addict
@CrispyandCalmm
@CrispyandCalmm 6 ай бұрын
Thanks Bro Free Education
@GamerDevIND
@GamerDevIND 6 ай бұрын
Bro is back to python 😊
@cruyffsworld9731
@cruyffsworld9731 6 ай бұрын
Can u explain algorithms and data structure in python , because ur explanations are the best .
@siciliandragon8654
@siciliandragon8654 4 ай бұрын
Just say bet = int(input("Place your bet amount: ) so you don't have to take the extra step and convert the string.
@enemdes3735
@enemdes3735 6 ай бұрын
This was so fun thanks for video 😂👍
@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
@RajaPatel-h3t
@RajaPatel-h3t 6 ай бұрын
Bro make videos on express js , node js
@nishawnbeckford2636
@nishawnbeckford2636 6 ай бұрын
Awesome vid
@NightMare-hi7vu
@NightMare-hi7vu 6 ай бұрын
Bro please make an updated version of the python full course just like the js one
@Jordan-qi2dn
@Jordan-qi2dn 6 ай бұрын
Hey Bro, would you be able to do an updated video of C#? And when are you streaming again?!
@technicalswag3925
@technicalswag3925 6 ай бұрын
Sir please continue and complete the react course
@osmanldevleti4858
@osmanldevleti4858 6 ай бұрын
It would be nice if you make a Mongoose video series.
@exactmidnight
@exactmidnight 6 ай бұрын
Cool blud keep winning love ya
@3minutesbibletruth
@3minutesbibletruth 6 ай бұрын
Thank you boss its been a while I guess I have missed a lot
@AukeiHD
@AukeiHD 6 ай бұрын
hey i really love your videos, I was wondering if you could make a video about "matlab".
@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.
@s.p_akash
@s.p_akash 6 ай бұрын
Broo can you make a video about Regular Expressions in Python
@bjrn-magnekristensen2444
@bjrn-magnekristensen2444 6 ай бұрын
ai this gave me insperation want to try it in c, thanks bigbro
@Bumblevie_
@Bumblevie_ 6 ай бұрын
thanks bro code
@ranz1040
@ranz1040 6 ай бұрын
Make a go language Playlist please
@jadotati7641
@jadotati7641 6 ай бұрын
Make an assembly course🙂!
@eifclub978
@eifclub978 6 ай бұрын
bro already sound like gigachad
@chetranshlasod5157
@chetranshlasod5157 6 ай бұрын
@BroCodez do data structures in panda pleasee love ur vids ..... 🙌
@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
@naveenshankar-jk2vd
@naveenshankar-jk2vd 6 ай бұрын
Try to.make videos for node js bro it is a upcoming source library
@jordankerr1
@jordankerr1 6 ай бұрын
Can you do ISpalindrome method/reverse string in c#?
@ideology8323
@ideology8323 6 ай бұрын
My bro, help me understand the express node js module!
@mdyusufansari8897
@mdyusufansari8897 6 ай бұрын
can we add these project in our cv
@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
@iDebashish
@iDebashish 6 ай бұрын
Please Bro do a full course of Kotlin.
@melkor1177
@melkor1177 6 ай бұрын
we need a kotlin tutorial
@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
@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.
@roelroel2k3
@roelroel2k3 6 ай бұрын
i copied everything but theres a bug in line 49, 45, 8 I'm using python 3.9.6
@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.
@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
@shricharanramesh7149
@shricharanramesh7149 6 ай бұрын
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 2 ай бұрын
Purpose of return -1 please...?? Actually why did you used in the code
@KingXJulien
@KingXJulien 6 ай бұрын
Kotlin please
@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.
@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
@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
Рет қаралды 22 М.
Please Master These 10 Python Functions…
22:17
Tech With Tim
Рет қаралды 243 М.
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 16 МЛН
Learn Python Object Oriented Programming! 🚗
12:18
Bro Code
Рет қаралды 34 М.
Let's code a beginner Python BANKING PROGRAM 💰
15:01
Bro Code
Рет қаралды 311 М.
Learn Python LIST COMPREHENSIONS in 10 minutes! 📃
10:20
Bro Code
Рет қаралды 15 М.
Python lists, sets, and tuples explained 🍍
15:06
Bro Code
Рет қаралды 338 М.
String methods in Python are easy 〰️
12:06
Bro Code
Рет қаралды 127 М.
10 Important Python Concepts In 20 Minutes
18:49
Indently
Рет қаралды 401 М.
DICE ROLLER program in Python ⚂
10:06
Bro Code
Рет қаралды 70 М.
3 PYTHON AUTOMATION PROJECTS FOR BEGINNERS
17:00
Internet Made Coder
Рет қаралды 1,7 МЛН
Functions in Python are easy 📞
10:38
Bro Code
Рет қаралды 609 М.
Python CLASS VARIABLES explained easy! 🎓
8:16
Bro Code
Рет қаралды 13 М.