Nexclap

Python version of Blackjack

Hi! This is my attempt at making a Python version of the card game Blackjack. The program is at a rudimentary stage and is a work in progress. I am still adding to it since it lacks some of the nuances of Blackjack. I hope you enjoy it!

from random import randint # A list with the different cards gamecards= [2, 3, 4, 5, 6, 7, 8, 9, 10, "Jack", "Queen", "King", "Ace"] # Defining different lists for the dealers's cards and the player's cards dealercards=[] playercards=[] # The dealer automatically get two cards in the beginning of the game while len(dealercards)< 2: x= randint(0,12) cardchosen= gamecards[x] if cardchosen == "Jack" or cardchosen =="Queen" or cardchosen == "King": dealercards.append(10) elif cardchosen== "Ace": dealercards.append(1) else: dealercards.append(cardchosen) print ("The dealer has a down facing card and", dealercards[1]) # The player automatically gets two cards in the beginning of the game while len(playercards)< 2: x= randint(0,12) playercardchosen= gamecards[x] if playercardchosen == "Jack" or playercardchosen=="Queen" or playercardchosen == "King": playercards.append(10) elif playercardchosen == "Ace": playercards.append(1) else: playercards.append(playercardchosen) if len(playercards) == 2: print ("Your cards are", playercards[0], "and", playercardchosen) Flag= False #Gameplay for the player while sum(playercards) < 21 and Flag == False: player_action= input("Do you want to hit or stay? ") if player_action == "stay" or player_action =="Stay": Flag= True elif player_action == "hit" or player_action =="Hit": y= randint(0,12) playercardchosen= gamecards[y] if playercardchosen == "Jack" or playercardchosen == "Queen" or playercardchosen == "King": playercards.append(10) print ("You got a", playercardchosen, "and your total now is", sum(playercards)) elif playercardchosen == "Ace": playercards.append(1) print ("You got a", playercardchosen, "and your total now is", sum(playercards)) else: playercards.append(playercardchosen) print ("You got a", playercardchosen, "and your total now is", sum(playercards)) #Finding what the dealer's total is while sum(dealercards)< 17: x= randint(0,12) cardchosen= gamecards[x] if cardchosen == "Jack" or cardchosen == "Queen" or cardchosen == "King": dealercards.append(10) print("The dealer's first card was", dealercards[0]) print ("The dealer got a", cardchosen, "and his total now is", sum(dealercards)) elif cardchosen == "Ace": dealercards.append(1) print (cardchosen) else :dealercards.append(cardchosen) print ("Your total is", sum(playercards), "and your cards are", playercards) print ("The dealer has ", dealercards, "and the total is", sum(dealercards)) if sum(dealercards) > 21 and sum(playercards) > 21: print ("It is a tie!") elif sum(dealercards) < 21 and sum(dealercards) > sum(playercards): print("The dealer wins!") elif sum(playercards) < 21 and sum (playercards) > sum(dealercards): print ("You win!") elif sum(playercards) > 21: print ("The dealer wins") elif sum(dealercards) > 21: print ("You win") elif sum(dealercards) == sum(playercards): print ("It is a tie!")

ddos-attack-detection-classification

Cyber security using ml

https://colab.research.google.com/drive/116pD4PKWuk2AOXzrrhbRTG018wZ8KRqX?usp=sharing

Classification Model for Criminals Included in Jail from a Crime Database

Predicting the criminals included in jails for crimes using different machine learning models using logistic regression we got 87% accuracy using decision tree we got 97% accuracy using support vector machine we got 87% accuracy

https://drive.google.com/file/d/17JVZ-u_jynjqIQk3H51IvgZ0uCKGr34h/view?usp=share_link
Announcements
  • Test Announcement from Nexclap

    Test message from nexclap - please ignore

    2023-02-13

  • Test message

    Test message from nexclap - please ignore

    2023-02-11

  • Test message

    Test message from nexclap - please ignore

    2023-02-11

  • View all