<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: SHAMEEM ALI</title>
    <description>The latest articles on DEV Community by SHAMEEM ALI (@shameem).</description>
    <link>https://dev.to/shameem</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F811206%2F206b5b6f-f8e9-4823-90ac-57a93f14c943.png</url>
      <title>DEV Community: SHAMEEM ALI</title>
      <link>https://dev.to/shameem</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shameem"/>
    <language>en</language>
    <item>
      <title>dict comprehension</title>
      <dc:creator>SHAMEEM ALI</dc:creator>
      <pubDate>Thu, 16 Jun 2022 01:05:38 +0000</pubDate>
      <link>https://dev.to/shameem/dict-comprehension-472j</link>
      <guid>https://dev.to/shameem/dict-comprehension-472j</guid>
      <description>&lt;p&gt;dict comprehension&lt;br&gt;
&lt;code&gt;new_dict = {new_key: new_value for (key,value) in dict.items()}&lt;/code&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>dict</category>
      <category>codepen</category>
    </item>
    <item>
      <title>Something share</title>
      <dc:creator>SHAMEEM ALI</dc:creator>
      <pubDate>Sun, 29 May 2022 09:09:56 +0000</pubDate>
      <link>https://dev.to/shameem/something-share-2hj3</link>
      <guid>https://dev.to/shameem/something-share-2hj3</guid>
      <description>&lt;p&gt;please share about pandas in python&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>pandas</category>
      <category>python</category>
    </item>
    <item>
      <title>Usage of "With" in python</title>
      <dc:creator>SHAMEEM ALI</dc:creator>
      <pubDate>Wed, 25 May 2022 15:26:31 +0000</pubDate>
      <link>https://dev.to/shameem/usage-of-with-in-python-m5g</link>
      <guid>https://dev.to/shameem/usage-of-with-in-python-m5g</guid>
      <description>&lt;p&gt;In python the "with" keyword is used when working with unmanaged resources (like file streams). It is similar to the using statement in VB.NET and C#. It allows you to ensure that a resource is "cleaned up" when the code that uses it finishes running, even if exceptions are thrown.&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Turtle Event Lisener</title>
      <dc:creator>SHAMEEM ALI</dc:creator>
      <pubDate>Sun, 08 May 2022 03:03:57 +0000</pubDate>
      <link>https://dev.to/shameem/turtle-event-lisener-2i3b</link>
      <guid>https://dev.to/shameem/turtle-event-lisener-2i3b</guid>
      <description>&lt;h3&gt;
  
  
  today notes(6/05/2022)
&lt;/h3&gt;

&lt;p&gt;1.turtle event lisener&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


turtle.lisen()
turtle.onkey(fun #create a function with parameter,key #set a key in alphabet &amp;amp; icons)
2.higher oder funtion
one funtion works with another funtion 
eg :def calculation(n1, n2, funtion)
    return funtion(n1, n2)


    calculation(1, 5, add)
add is funtion 

#python commonly use but other language not
3.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Turtle studies</title>
      <dc:creator>SHAMEEM ALI</dc:creator>
      <pubDate>Fri, 06 May 2022 02:10:55 +0000</pubDate>
      <link>https://dev.to/shameem/turtle-studies-2080</link>
      <guid>https://dev.to/shameem/turtle-studies-2080</guid>
      <description>&lt;h2&gt;
  
  
  today notes
&lt;/h2&gt;

&lt;p&gt;Turtle Graphics &lt;br&gt;
1.screen usage &lt;br&gt;
2.change color of the turtle logo&lt;br&gt;
3.Tkinder with GUI&lt;br&gt;
4.Aliasing modules (as)&lt;br&gt;
eg : import tkinder as tk&lt;br&gt;
5.Pyhton Tuples &lt;br&gt;
tuple like as stone you can't change the values , it is immutable &lt;br&gt;
&lt;strong&gt;&lt;em&gt;usage of Tuple&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
-creating a color scheme for your web site&lt;br&gt;
-a list thst you to stay constant&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;to convert in list &lt;br&gt;
list(my_tuple) &lt;br&gt;
6.colormode() This function is used to return the color mode or set it to 1.0 or 255. (r, g, b) values of color triples have to be in range 0 to c mode&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Extra studies&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;double quotes are used for string representation and single quotes are used for regular expressions,
2.turtle.setheading(angle): Sets    the orientation of  the turtle  to  angle.  Here    are some
common  directions  in  degrees:    0   (east), 90  (north),    180 (west), 270 (south).&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>turtle</category>
      <category>tutorial</category>
      <category>100daysofcode</category>
      <category>python</category>
    </item>
    <item>
      <title>Tuple and usage</title>
      <dc:creator>SHAMEEM ALI</dc:creator>
      <pubDate>Thu, 05 May 2022 10:06:50 +0000</pubDate>
      <link>https://dev.to/shameem/tuple-and-usage-312f</link>
      <guid>https://dev.to/shameem/tuple-and-usage-312f</guid>
      <description>&lt;p&gt;&lt;strong&gt;## Pyhton Tuples **&lt;br&gt;
tuple like as stone you can't change the values , it is immutable &lt;br&gt;
**&lt;strong&gt;&lt;em&gt;usage of Tuple&lt;/em&gt;&lt;/strong&gt;&lt;/strong&gt;&lt;br&gt;
-creating a color scheme for your web site&lt;br&gt;
-a list that you to stay constant&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.tourl"&gt;&lt;br&gt;
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EKePGaj9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5voqmc4i95fib6jxyamq.jpg" alt="Image description" width="293" height="172"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;to convert in list&lt;br&gt;
list(my_tuple) &lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>tuple</category>
      <category>python</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Cases</title>
      <dc:creator>SHAMEEM ALI</dc:creator>
      <pubDate>Wed, 04 May 2022 01:55:44 +0000</pubDate>
      <link>https://dev.to/shameem/cases-52pm</link>
      <guid>https://dev.to/shameem/cases-52pm</guid>
      <description>&lt;p&gt;1.PascalCase&lt;br&gt;
First letter capitalize&lt;br&gt;
PHILOSOPHY - Blaise Pascal&lt;br&gt;
&lt;a href="https://youtu.be/3nb4nYqNXyM"&gt;https://youtu.be/3nb4nYqNXyM&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2.camelCase&lt;br&gt;
First word letter small, but second capital&lt;/p&gt;

&lt;p&gt;Eg: udemyCoursera&lt;/p&gt;

&lt;p&gt;3.snake_case&lt;br&gt;
All letters small, word seprated by underscore 🤞&lt;/p&gt;

&lt;p&gt;Eg: shameem_ali&lt;/p&gt;

</description>
      <category>pascalcas</category>
      <category>coding</category>
      <category>programming</category>
      <category>python</category>
    </item>
    <item>
      <title>Today studies</title>
      <dc:creator>SHAMEEM ALI</dc:creator>
      <pubDate>Sun, 01 May 2022 13:50:55 +0000</pubDate>
      <link>https://dev.to/shameem/today-studies-5a9o</link>
      <guid>https://dev.to/shameem/today-studies-5a9o</guid>
      <description>&lt;p&gt;-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Oops Concept&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;attributes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;methods&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Usage of concept &lt;/p&gt;

</description>
      <category>python</category>
      <category>study</category>
      <category>programming</category>
      <category>oops</category>
    </item>
    <item>
      <title>Turtle study</title>
      <dc:creator>SHAMEEM ALI</dc:creator>
      <pubDate>Sun, 01 May 2022 00:16:17 +0000</pubDate>
      <link>https://dev.to/shameem/turtle-study-1mfl</link>
      <guid>https://dev.to/shameem/turtle-study-1mfl</guid>
      <description>&lt;p&gt;Choose the fill color by calling fillcolor() function and pass the color name or color in the #RRGGBB format. After step 1, you must call begin_fill() and then start drawing using Turtle functions. Once you are done with the drawing, call end_fill() function to fill the drawn figure with the selected color&lt;br&gt;
1.begin_fill() in first time&lt;br&gt;
2.end_fill() in last time&lt;/p&gt;

</description>
      <category>firstpost</category>
      <category>python</category>
      <category>turtle</category>
      <category>programming</category>
    </item>
    <item>
      <title>A Guess Game</title>
      <dc:creator>SHAMEEM ALI</dc:creator>
      <pubDate>Fri, 22 Apr 2022 18:05:24 +0000</pubDate>
      <link>https://dev.to/shameem/a-guess-game-11mk</link>
      <guid>https://dev.to/shameem/a-guess-game-11mk</guid>
      <description>&lt;p&gt;`#Number Guessing Game Objectives:&lt;br&gt;
from random import randint&lt;br&gt;
EASY_LEVEL = 10&lt;br&gt;
HARD_LEVEL = 5&lt;br&gt;
def difficulty():&lt;br&gt;
  if input("Choose difficultty type 'easy'or 'hard'")=="easy":&lt;br&gt;
    return EASY_LEVEL&lt;br&gt;
  else:&lt;br&gt;
    return HARD_LEVEL&lt;/p&gt;

&lt;p&gt;def checking_ans(guess,answer,turning_point):&lt;br&gt;
  if guess &amp;gt; answer:&lt;br&gt;
    print("Too high")&lt;br&gt;
    return turning_point - 1&lt;br&gt;
  elif guess &amp;lt; answer :&lt;br&gt;
    print("Too low")&lt;br&gt;
    return turning_point -1&lt;br&gt;
  else:&lt;br&gt;
    return f"You answered {answer}"&lt;/p&gt;

&lt;h1&gt;
  
  
  Include an ASCII art logo.
&lt;/h1&gt;

&lt;h1&gt;
  
  
  Allow the player to submit a guess for a number between 1 and 100.
&lt;/h1&gt;

&lt;h1&gt;
  
  
  Check user's guess against actual answer. Print "Too high." or "Too low." depending on the user's answer.
&lt;/h1&gt;

&lt;h1&gt;
  
  
  If they got the answer correct, show the actual answer to the player.
&lt;/h1&gt;

&lt;h1&gt;
  
  
  Track the number of turns remaining.
&lt;/h1&gt;

&lt;h1&gt;
  
  
  If they run out of turns, provide feedback to the player.
&lt;/h1&gt;

&lt;h1&gt;
  
  
  Include two different difficulty levels (e.g., 10 guesses in easy mode, only 5 guesses in hard mode).
&lt;/h1&gt;

&lt;p&gt;def game():&lt;br&gt;
  print("WELCOME GUESSING GAME")&lt;br&gt;
  print("I am thinking of a number between 1 to ")&lt;br&gt;
  answer = randint(1,100)&lt;br&gt;
  turning_point = difficulty()&lt;br&gt;
  print(f"You have {turning_point} attemtts") &lt;br&gt;
  guess = 0 &lt;br&gt;
  while guess != answer:&lt;br&gt;
    guessing = int(input("Make a guess :"))&lt;br&gt;
    turning_point = checking_ans(guess,answer,turning_point)&lt;br&gt;
    if turning_point == 0 :&lt;br&gt;
      return "you are tired , chances compled"&lt;br&gt;
    elif guess != answer:&lt;br&gt;
      return "Make guess...."&lt;/p&gt;

&lt;p&gt;game()&lt;/p&gt;

&lt;p&gt;`&lt;/p&gt;

</description>
      <category>python</category>
      <category>guessgame</category>
      <category>webdev</category>
      <category>coder</category>
    </item>
    <item>
      <title>My First Project - Black jack project</title>
      <dc:creator>SHAMEEM ALI</dc:creator>
      <pubDate>Fri, 22 Apr 2022 04:52:01 +0000</pubDate>
      <link>https://dev.to/shameem/my-first-project-black-jack-project-3m0g</link>
      <guid>https://dev.to/shameem/my-first-project-black-jack-project-3m0g</guid>
      <description>&lt;h1&gt;
  
  
  Hint 4: Create a deal_card() function that uses the List below to &lt;em&gt;return&lt;/em&gt; a random card.
&lt;/h1&gt;

&lt;h1&gt;
  
  
  11 is the Ace.
&lt;/h1&gt;

&lt;p&gt;import random&lt;/p&gt;

&lt;p&gt;def deal_card():&lt;br&gt;
  """Returns a random card from the deck."""&lt;br&gt;
  cards = [11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10]&lt;br&gt;
  card = random.choice(cards)&lt;br&gt;
  return card&lt;/p&gt;

&lt;h1&gt;
  
  
  Hint 6: Create a function called calculate_score() that takes a List of cards as input
&lt;/h1&gt;

&lt;h1&gt;
  
  
  and returns the score.
&lt;/h1&gt;

&lt;h1&gt;
  
  
  Look up the sum() function to help you do this.
&lt;/h1&gt;

&lt;p&gt;def calculate_score(cards):&lt;br&gt;
  """Take a list of cards and return the score calculated from the cards"""&lt;/p&gt;

&lt;p&gt;#Hint 7: Inside calculate_score() check for a blackjack (a hand with only 2 cards: ace + 10) and return 0 instead of the actual score. 0 will represent a blackjack in our game.&lt;br&gt;
  if sum(cards) == 21 and len(cards) == 2:&lt;br&gt;
    return 0&lt;br&gt;
  #Hint 8: Inside calculate_score() check for an 11 (ace). If the score is already over 21, remove the 11 and replace it with a 1. You might need to look up append() and remove&lt;br&gt;
def compare(user_score, computer_score):&lt;br&gt;
  #Bug fix. If you and the computer are both over, you lose.&lt;br&gt;
  if user_score &amp;gt; 21 and computer_score &amp;gt; 21:&lt;br&gt;
    return "You went over. You lose 😤"&lt;/p&gt;

&lt;p&gt;if user_score == computer_score:&lt;br&gt;
    return "Draw 🙃"&lt;br&gt;
  elif computer_score == 0:&lt;br&gt;
    return "Lose, opponent has Blackjack 😱"&lt;br&gt;
  elif user_score == 0:&lt;br&gt;
    return "Win with a Blackjack 😎"&lt;br&gt;
  elif user_score &amp;gt; 21:&lt;br&gt;
    return "You went over. You lose 😭"&lt;br&gt;
  elif computer_score &amp;gt; 21:&lt;br&gt;
    return "Opponent went over. You win 😁"&lt;br&gt;
  elif user_score &amp;gt; computer_score:&lt;br&gt;
    return "You win 😃"&lt;br&gt;
  else:&lt;br&gt;
    return "You lose 😤"&lt;/p&gt;

&lt;p&gt;def play_game():&lt;br&gt;
  #Hint 5: Deal the user and computer 2 cards each using deal_card()&lt;br&gt;
  user_cards = []&lt;br&gt;
  computer_cards = []&lt;br&gt;
  is_game_over = False&lt;/p&gt;

&lt;p&gt;for _ in range(2):&lt;br&gt;
    user_cards.append(deal_card())&lt;br&gt;
    computer_cards.append(deal_card())&lt;/p&gt;

&lt;p&gt;#Hint 11: The score will need to be rechecked with every new card drawn and the checks in Hint 9 need to be repeated until the game ends.&lt;/p&gt;

&lt;p&gt;while not is_game_over:&lt;br&gt;
    #Hint 9: Call calculate_score(). If the computer or the user has a blackjack (0) or if the user's score is over 21, then the game ends.&lt;br&gt;
    user_score = calculate_score(user_cards)&lt;br&gt;
    computer_score = calculate_score(computer_cards)&lt;br&gt;
    print(f"   Your cards: {user_cards}, current score: {user_score}")&lt;br&gt;
    print(f"   Computer's first card: {computer_cards[0]}")&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if user_score == 0 or computer_score == 0 or user_score &amp;gt; 21:
  is_game_over = True
else:
  #Hint 10: If the game has not ended, ask the user if they want to draw another card. If yes, then use the deal_card() function to add another card to the user_cards List. If no, then the game has ended.
  user_should_deal = input("Type 'y' to get another card, type 'n' to pass: ")
  if user_should_deal == "y":
    user_cards.append(deal_card())
  else:
    is_game_over = True
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;#Hint 12: Once the user is done, it's time to let the computer play. The computer should keep drawing cards as long as it has a score less than 17.&lt;br&gt;
  while computer_score != 0 and computer_score &amp;lt; 17:&lt;br&gt;
    computer_cards.append(deal_card())&lt;br&gt;
    computer_score = calculate_score(computer_cards)&lt;/p&gt;

&lt;p&gt;print(f"   Your final hand: {user_cards}, final score: {user_score}")&lt;br&gt;
  print(f"   Computer's final hand: {computer_cards}, final score: {computer_score}")&lt;br&gt;
  print(compare(user_score, computer_score))&lt;/p&gt;

&lt;h1&gt;
  
  
  Hint 14: Ask the user if they want to restart the game. If they answer yes, clear the console and start a new game of blackjack and show the logo from art.py.
&lt;/h1&gt;

&lt;p&gt;while input("Do you want to play a game of Blackjack? Type 'y' or 'n': ") == "y":&lt;br&gt;
  play_game()&lt;/p&gt;

&lt;p&gt;`&lt;/p&gt;

</description>
      <category>python</category>
      <category>blackjackprojec</category>
      <category>myfirstproject</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
