Showing posts with label do my python homework. Show all posts
Showing posts with label do my python homework. Show all posts

Wednesday, May 15, 2019

How Can We Do My Python Assignment for You?


My very first assignment at University was to program a game of 21, although it was a cut down version. The assignment was in Pascal, so I have converted the code into Python to demonstrate a simple assignment. The basic rules of BlackJack (21, Pontoon) are that you have a deck of cards, and face cards count as 10 (Jack, Queen, King), and the Ace can count as 1 or 11. You see your cards, but not the dealers (you see one of the dealers cards) and you decide whether to stop where you are or to draw a new card. Once you have finished, the dealer takes their turn, and will draw if the value of the hand is less than 17. I’ve not included comments in the code, but I would do if it was a real assignment.
# Blackjack (21 or Pontoon)

import random

class Card:

    deck = []

    def __init__(self, rank, suit):
        if rank == "1":
            rank = "10"
        self.rank = rank
        self.suit = suit
        if rank in "JQK":
            self.val = 10
        elif rank == "A":
            self.val = 11
        else:
            self.val = int(rank)

    def __str__(self):
        return "%s%s" % (self.rank, self.suit)

    def __repr__(self):
        return str(self)

class Deck:

    def __init__(self):
        self.__deck = [Card(rank, suit) for suit in "CDHS" for rank in "234567891JQKA"]
        self.shuffle()

    def draw(self):
        card = self.__deck[self.__index]
        self.__index += 1
        return card

    def shuffle(self):
        random.shuffle(self.__deck)
        self.__index = 0

    def show_hand(self, hand):
        return "%s (%d)" % (",".join(str(card) for card in hand), self.score(hand))

    def score(self, hand):
        total = 0
        aces = 0
        for card in hand:
            total += card.val
            if card.val == 11:
                aces += 1
        while total > 21 and aces:
            total -= 10
            aces -= 1
        return total


def main():
    pot = 20
    while pot > 0:
        bet = int(input("You have %d available, how much do you want to bet? (0 to end) " % pot))
        if not bet:
            break
        if bet < 1:
            bet = 1
        if bet > pot:
            bet = pot
        deck = Deck()
        player = [deck.draw(), deck.draw()]
        dealer = [deck.draw(), deck.draw()]
        pot -= bet
        while True:
            print("You have:", deck.show_hand(player))
            print("Dealer shows:", dealer[0])
            move = input("(s)tick, (d)raw: ")
            if move in "sS":
                break
            if move in "dD":
                player.append(deck.draw())
            player_score = deck.score(player)
            if player_score > 21:
                break

        player_score = deck.score(player)
        if player_score > 21:
            print("Player bust")
            continue

        dealer_score = deck.score(dealer)
        print("Dealer has:", deck.show_hand(dealer))
        while dealer_score < 17:
            dealer.append(deck.draw())
            dealer_score = deck.score(dealer)
            print("Dealer has:", deck.show_hand(dealer))

        if dealer_score > 21:
            print("Dealer bust")
            pot += bet * 2
        elif player_score == dealer_score:
            print("Draw")
            pot += bet
        elif dealer_score > player_score:
            print("Dealer wins")
        else:
            print("You win")
            pot += bet * 2

    print("\n\nYou ended up with $%d" % pot)


main()


We can work on assignments far more complex than this, and in multiple programming languages. I’ve used Python to write GUI programs, web servers, games (using Pygame) and even a simple compiler.

You can rely on Programming Assignment Helper if you need someone to do my Python homework.

Thursday, March 28, 2019

Who Can I to Contact to Do My Python Assignment?


Python programming language is very difficult especially for students who are not very adept in coding. Most students struggle more than others even leading to programming myths like programming is only for those over achieving or excellent students. However, that’s not really the case, with a lot of studying and regular practice, almost any student can learn and understand programming. It all just boils down to the level of interest, there in lies the difference.


Even so, whether you may be interested in pursuing Python programming or not, it may be the only thing standing in your way to a better career as a programming students or computer science student. Hence, passing your python assignments and exams becomes crucial if you want to graduate at the top of your class with top grades. Employers in these related fields only seek to hire the best.

This is where the dilemma comes in, to pass or not to pass. If you look further into what you want out of the time you took to learn all that python programming knowledge, you will realize that you have no choice but to pass. You are left asking yourself “who can I contact to do my python assignment?”. The only realistic answer you get is to seek only the best online python assignment help. We at programmingassignementhelper.com are that answer.

Our services caters to those struggling students who would seek only the best expert help in Python programming which will ensure they emerge top of their class with top grades.

We have excellent, qualified and experienced tutors who offer online tutoring to students who after the end of the class did not understand much of what the professor taught. Our experts will undertake any python assignment given to you for that day’s lesson and deliver it on time and our tutors will assist in explaining the concepts to ensure you have gotten that extra time to completely understand the lesson. This is a simple process requiring one to schedule a session with our online tutors on our websiteat programmingassignmenthelper.com either via phone call by tutor or live chat on Skype.

Some python assignments or projects mag be too complex to complete on your own. We however have experts with the necessary knowledge and experience to know what exactly your professor is looking for as the solution to the problem at hand. You are guaranteed to impress your professor with the quality solution we deliver.

All the coding is done from scratch, kept simple and of high quality. This eliminates any elements of plagiarism. You will never find a copy paste work from us as we stick closely to our principle of zero tolerance to plagiarism. We love what we do and we know the risk posed to students who submit copied work. Our mission is to help build the student academically not to test down their dreams.

We have managed to meet all our deadlines by submitting our solutions on time. If we can’t meet a strict deadline then we will tell you in advance. Hence it’s good to always ask for help earlier. Our services are very affordable and our online customer support is the best, very professional and available 24/7. Read more about for related posts!