<jupyter_start><jupyter_text>Assignment 2.1 Birthdays and Zeller's algorithm. Zeller's algorithm computes the day of the week on which a given date will fall (or fell). Use the description of Zeller's algorithm, given below, to write a Python script that computes the day of the week on which the user"s birthday fell in the year they were born and prints the result to the screen.  Zeller's algorithm: - We first define the following variables (which each stores a non-negative integer):     - `month`: This variable corresponds to the month of the year (ranging from 3 to 14), with March having the value 3, April the value 4, …, December the value 12, and January and February (of the following year) being counted as months 13 and 14. Note that if `month == 13` or `month == 14`, then you should adjust `year` such that `year = year - 1`.     - `year`: This variable corresponds to the year of the century (e.g., `year == 89` for the year 1989;   `year = 5` for the year 2005).     - `yy`: This variable corresponds to the last 2 digits of `year`.  For examples, `yy == 89` for the year 1989 and `yy == 5` for the year 2005.     - `century`: This variable corresponds to the first 2 digits of `year`. For examples, `century == 19` for the year 1989 and `century == 20` for the year 2005.     - `day`: This variable corresponds to the day of the month, i.e., an integer values between 1 and 31. - The day of the week is then calculated by     - first computing `resultant` using the following formula: $$\tt{resultant}=\left({\tt day}+\left\lfloor \frac{13\left({\tt month}+1\right)}{5}\right\rfloor +{\tt yy}+\left\lfloor \frac{{\tt yy}}{4}\right\rfloor+\left\lfloor \frac{{\tt century}}{4}\right\rfloor -2\times{\tt century}\right) \mod 7.$$    - Followed by matching `resultant` value to its corresponding values under `Day of the Week` column in the following table: | Resultant | Day of the Week ||-----------|-----------------|| 0         | Saturday        || 1         | Sunday          || 2         | Monday          || 3         | Tuesday         || 4         | Wednesday       || 5         | Thursday        || 6         | Friday          |The problem:- Have the user input their birth date. - Use Zeller's algorithm to compute the day of the week on which they were born. - Print out that day. Example interaction: >Date of Birth? 20>Month of Birth? 5>Year of Birth? 2005>You were born on Friday.<jupyter_code>import math
days = ['Saturday', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday']
date = int(input("Please input your date of birth in DD form: "))
month = int(input("Please input your month of birth in MM form: "))
year = str(input("Please input your year of birth in YYYY form: "))
if month <= 2:
    month += 12
yy = (year[2: ])
century = (year[ :2])
resultant = int((date + (13*(month+1))/5 + int(yy) + int(yy)/4 + (int(century)/4) - 2*int(century))%7)

print("You were born on", days[resultant])<jupyter_output>Please input your date of birth in DD form: 20
Please input your month of birth in MM form: 05
Please input your year of birth in YYYY form: 2005
You were born on Friday<jupyter_text>Assignment 2.2 Rock, Paper, Scissors, Lizard, SpockIn this exercise, you are going to further practice using conditionals (`if`, `elif`, `else`). You will write a small program that will determine the result of a Rock, Paper, Scissors, Lizard, Spock game.  For the rules of the game, please which the following clip from "The Big Bang Theory": [https://www.youtube.com/watch?v=_PUEoDYpUyQ][![Everything Is AWESOME](http://img.youtube.com/vi/_PUEoDYpUyQ/0.jpg)](https://youtu.be/_PUEoDYpUyQ "Everything Is AWESOME")  The problem: - Write a program that will first request the input for Player 1 and Player 2's choices. - Next, the program will compare the inputs and print out the result of the game (i.e., who the winner is).  Example interaction: >Player 1? >rock>Player 2?>scissors>Player 1 wins<jupyter_code>a = input("Player 1, rock, paper, scissors, lizard or spock?: ")
b = input("Player 2, rock, paper, scissors, lizard or spock?: ")

if a == 'scissors' and b == 'paper':
    print("Player 1 wins")
if a == 'paper' and b == 'rock':
    print("Player 1 wins")
if a == 'rock' and b == 'lizard':
    print("Player 1 wins")
if a == 'lizard' and b == 'spock':
    print("Player 1 wins")
if a == 'spock' and b == 'scissors':
    print("Player 1 wins")
if a == 'scissors' and b == 'lizard':
    print("Player 1 wins")
if a == 'lizard' and b == 'paper':
    print("Player 1 wins")
if a == 'paper' and b == 'spock':
    print("Player 1 wins")
if a == 'spock' and b == 'rock':
    print("Player 1 wins")
if a == 'rock' and b == 'scissors':
    print("Player 1 wins")
    
if a == 'paper' and b == 'scissors':
    print("Player 2 wins")
if a == 'rock' and b == 'paper':
    print("Player 2 wins")
if a == 'lizard' and b == 'rock':
    print("Player 2 wins")
if a == 'spock' and b == 'lizard':
    print("Player 2 wins")
if a == 'scissors' and b == 'spock':
    print("Player 2 wins")
if a == 'lizard' and b == 'scissors':
    print("Player 2 wins")
if a == 'paper' and b == 'lizard':
    print("Player 2 wins")
if a == 'spock' and b == 'paper':
    print("Player 2 wins")
if a == 'rock' and b == 'spock':
    print("Player 2 wins")
if a == 'scissors' and b == 'rock':
    print("Player 2 wins")<jupyter_output>Player 1, rock, paper, scissors, lizard or spock?: rock
Player 2, rock, paper, scissors, lizard or spock?: scissors
Player 1 wins<jupyter_text>Assignment 2.3 The $i$th prime numberYour program should print the $i$th prime number where $i$ is a user defined input. You may use the calculator on the following website to check your answer: [http://www.bigprimes.net/archive/prime/] The problem: - Request an integer input from the user. - Compute the $i$-th prime number, such that $i$ is the integer input by the user above. - Print the $i$-th prime numberExample interaction: > Input i, where $p_i$ is the $i$th prime number: > 101> The 101th prime number is : > 547<jupyter_code>i = int(input("Input i, where  𝑝𝑖 is the  𝑖th prime number: "))
prime_validation = True
prime = 3
counter = 0
while True:
    isPrime = True
    for u in range(2, int(prime**.5+1)):
        if prime%u == 0:
            isPrime = False
            break
    if isPrime:
        counter+=1
    if counter == i-1:
        break
    prime += 1
    
print(prime)<jupyter_output>Input i, where  𝑝𝑖 is the  𝑖th prime number: 101
547
{'fraction_non_alphanumeric': 0.13209302325581396, 'fraction_numerical': 0.024651162790697675, 'mean_word_length': 3.4094326725905675, 'pattern_counts': {'":': 1, '<': 11, '<?xml version=': 0, '>': 23, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '489841', 'license': 'MIT', 'n_tokens_mistral': 2144, 'n_tokens_neox': 1943, 'n_words': 892, 'path': 'Assignment-2.ipynb', 'repo_name': 'meryldany/lesson-1', 'size': '6450'}