title: How to add new data to the dictionary
body: <p>I designed a small python program
  If the student's name is entered, one can
  check their grade.</p>
  <p>My problem is if I enter the student name and if it
  cannot be found in the dictionary data, I must add a new student name to the dictionary. (using If statement)</p>
  <p>The system immediately allows the user to enter a new piece of grade data and
  the new student's name and grade data is added to the dictionary
  How to design and achieve it?
  I hope to achieve</p>
  <p>The first:</p>
  <pre><code>Enter student name: amy
  Student score: 85
  Dictionary content: {&quot;amy&quot;:85,&quot;lisa&quot;:93,&quot;jason&quot;:67,&quot;}
  </code></pre>
  <p>The second type:</p>
  <pre><code>Enter student name: sherry
  Enter student score: 90
  Dictionary content: {&quot;amy&quot;:85,&quot;lisa&quot;:93,&quot;jason&quot;:67,&quot;sherry&quot;:90}
  </code></pre>
  <p>Add new student name and student score to the list
  My code</p>
  <pre><code>stu=input(&quot;Enter student name:&quot;)
  score={&quot;amy&quot;:85,&quot;lisa&quot;:93,&quot;jason&quot;:67,&quot;}
  if stu==None:
      sco=int(input(&quot;Enter student score&quot;))
  else:
     print(&quot;Student score:&quot;,score.get(stu))
  </code></pre>