Assignment 3: Dictionaries, User Input, and while Loop

This assignment consists of two parts. Write Part A, in "part_A.py", and write Part B in "part_B.py". Write the answers of the questions in the available space.
Part AIn this assignment, we are trying to make a simple RPG character.
  1. Make a dictionary called char_1 containing the following info:
    Name: Marth,
    HP: 41,
    Attack: 31,
    Speed: 34,
    Defense: 29,
    Resistance: 23,
    Evasion: 11
    Then, using that dictionary. Print the following line:
    Character name: Marth
  2. Print the dictionary.
    - Add the HP for char_1 by 3 using +=.
    - Then, add this print "Your character gains 3 HP."
    - Then print the dictionary again to see if the HP has increased
    - Delete this key-value pair for Evasion from char_1.
    - Then print the dictionary again to see if that stats already deleted.
  3. Using for loop, print all the key-value pair in char_1 as follows:
    Name : Marth
    HP : 41
    ...
  4. Make char_2 and char_3 with the following information:
    • Name: Caeda, HP: 36, Attack: 25, Speed: 37, Defense: 24, Resistance: 34
    • Name: Merric, HP: 43, Attack: 26, Speed: 32, Defense: 28, Resistance: 19
      Make a new dictionary chars containing char_1, char_2, and char_3 with the following keys MAR1, CAE1, MER1, respectively.
  5. Using for loop, print all the character stats using the following format:
    Character ID : MAR1
    Character Name : Marth
    Total Stats : 158

    (Total stats is the summation of HP, Attack, Speed, Defense, and Resistance here)
Part BIn this assignment, we are trying to make a simple user input program.
  1. Ask the user their favorite integer like this "What is your favorite integer? ". Put that input in a variable called number.
  2. Using modulo operator, print something like
    Do you know that if {inputted number from no.1} is divided by 3, the remainder is {the remainder from modulo operator}?
  3. Using if statement, write "Your number is divisible by 3!" if it is divisible by 3, and "Your number is not divisible by 3!" otherwise.
  4. Copy the code you make in no.1 & no.2 and put them in while True block so the prompt will keep asking the number. Make sure the program quit if the user write 'quit'.
  5. Make empty list called numbers. Every time the user input code in no.4, add the inputted number to that list. At the end of program, print Here are the numbers you've typed in followed by print(numbers).
Submission Deadline

Tuesday,
October 27, 2020
16:20