This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class Hand: | |
| def __init__(self, name): | |
| self.name = name | |
| self.cards = [] # start with an empty list as we did in the Deck class | |
| self.value = 0 # start with zero value | |
| self.aces = 0 # add an attribute to keep track of aces | |
| def add_card(self,card): | |
| # Code Implementation solves the issue with | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env python | |
| # coding: utf-8 | |
| # In[1]: | |
| import random | |
| # Creation of the card class should include the following properties: Suit, Rank, Value | |
| values = {'Two':2,'Three':3,'Four':4,'Five':5,'Six':6,'Seven':7,'Eight':8,'Nine':9,'Ten':9,'Jack':11, | |
| 'Queen':12,'King':13,'Ace':14} | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | """ | |
| This module documents the definition and how to use | |
| decorators in a python program. | |
| """ | |
| # Python has decorators which allow users to tack on extra functionality | |
| # to an already existing function. It uses the @ operator to do so. | |
| # manually buidling out a decorator function: | |
| def func(): | |
| return 1 | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | the_table = list() | |
| the_table.append('X') | |
| the_table.append('X') | |
| the_table.append('X') | |
| the_table.append('X') | |
| the_table.append('X') | |
| the_table.append('X') | |
| the_table.append('X') | |
| the_table.append('X') | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | """module docstring""" | |
| from collections import Counter | |
| SAMPLE_STRING = 'Hello Mr. Rogers, how are you this fine Tuesday?' | |
| def count_upper(sentence): | |
| """Function docstring""" | |
| split_string = sentence.split(" ") | |
| for item in split_string: | |
| if item[0].isupper(): | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | start = 11 | |
| end = 25 | |
| for val in range(start, end + 1): | |
| if val > 1: | |
| for n in range(2, val//2 + 2): | |
| if (val % n) == 0: | |
| break | |
| else: | |
| if n == val//2 + 1: | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #Example 1: Find the index of the element in vowels | |
| vowels = ['a', 'e', 'i', 'o', 'i', 'u'] | |
| # index of 'e' in vowels index = | |
| vowels.index('e') print('The index of e:', index) | |
| # element 'i' is searched # index of the first 'i' is returned index = vowels.index('i') print('The index of i:', index) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | def common_member(a,b): | |
| a_set = set(a) | |
| b_set = set(b) | |
| if len(a_set.intersection(b_set)) > 0: | |
| return a_set.intersection(b_set) | |
| else: | |
| return "No common elements" | |
| a = [1,5,9,8,4,5,7] | |
| b = [3,14,8,7,9,87,58,5,6] | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Website with more info https://bit.ly/3d5WMoR | |
| #List have to be same length | |
| first= (1,2,3,4,5,6) | |
| last=(6,5,4,3,2,1) | |
| for i in range(len(first)): | |
| l1 = first[i] | |
| l2 = last[i] | |
| if l1 < l2: | |
| print("l1 < l2") | |
| elif l1 > l2: | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | public class BarkingDog{ | |
| public static void main(String[] args) { | |
| boolean theResult = shouldWakeUp(false, 2); | |
| System.out.println(theResult); | |
| } | |
| public static boolean shouldWakeUp(boolean barking, int hourOfDay){ | |
| boolean wakeUp = false; | |
| barking = false; | |
| if ( hourOfDay >= 0 && hourOfDay <= 7){ //Sleeping after midnight | |
| if (barking = true){ | 
NewerOlder