<jupyter_start><jupyter_text>EHB 420E Artificial Neural Networks Homework - 1<NAME>  Problem - 1---Create a program that asks the user to enter their name and their age. Print out a messageaddressed to them that tells them the year that they will turn 100 years old.<jupyter_code>from time import gmtime, strftime
name = input("Please Enter Your Name: ")
age = input("Please Enter Your Age: ")
current_year = gmtime()[0]
hndrd_year = current_year - int(age) + 100 
hndrd_year<jupyter_output><empty_output><jupyter_text>Problem - 2---Write a Python program to print the following string in a specific format<jupyter_code>print("Twinkle, twinkle, little star,\n\tHow I wonder what you are!\n\t\tUp above the world so high,\n\t\tLike a diamond in the sky.\nTwinkle, twinkle, little star,\n\tHow I wonder what you are")
from time import gmtime, strftime
print("Current date and time :")
time.strftime("%Y %H:%M:%S", gmtime())<jupyter_output>Current date and time :<jupyter_text>Problem - 3---Compute and print both roots of the quadratic equation x2-5.86 x+ 8.5408<jupyter_code>a = 1
b = -5.86
c = 8.5408
root1 = (-b + (b**2 - 4*a*c)**(0.5))/2*a
root2 = (-b - (b**2 - 4*a*c)**(0.5))/2*a
print("First root is :", root1)
print("Second root is :", root2)<jupyter_output>First root is : 3.1400000000000006
Second root is : 2.7199999999999998<jupyter_text>Problem - 4---Explain Bitwise, special, and membership operators.  Bitwise operations **Bitwise** operations are the operations that are in bit level. It lets the developer manipulate and work with bit patterns or binary numerals. It has massive various usage as expected. Developer can perform logic operations such as xor, or , and , not etc. It is very useful and powerful tool while considering various conditions to process in the code line. Some of the well known bitwise operations for python can be seen below.<jupyter_code>x = 4
y = 5

#Bitwise OR operation
print("x | y =", x | y)
 
#Bitwise NOT operation
print("~x =", ~x)

#Bitwise AND operation
print("x & y =", x & y)
  
#Bitwise XOR operation
print("x ^ y =", x ^ y)<jupyter_output>x | y = 5
~x = -5
x & y = 4
x ^ y = 1<jupyter_text>Special Operators Special operators are what make the coding writable. For example, the summing or subtraction operation in the computer is a barely time-consuming operation from a coding perspective. Instead of using 1's and 0's and complementary kinds of stuff, python has just a "+" sign to sum up two variables even it can sum two strings which is hard to code with just 1's and 0's. There are lots of special operators like the "+" sign in Python. "=", "//", "**", "%", "-", "/", "*" are the well known examples of special operators. Developers can easily perform mathematical and string operations using these operators. In python, these operators are much users friendly and easy because of python's English or text-like commands compare to its competitors. Code examples of some operators can be seen below.<jupyter_code>a = 9; b = 11
sum = a + b #Summing operation
sum
mod = sum % 3 #Mod operation
mod
power = 4 ** 2 #Power of given number
power
x = 12
y = 9
floor_division = x // y #Floor division - division that results into whole number adjusted to the left in the number line	
floor_division
eq = ((x * y // 2) ** 3) / 2 #Simple math equation with special operators
eq
code = "EHB 424E "
name = "Artificial Neural Networks"
string_sum = code + name #String sum operation
string_sum<jupyter_output><empty_output><jupyter_text>Membership Operators Membership operators are checking whether the specified member is in a  given sequence. There are two membership operators in Python and these are "in" and "not in". The code example of membership operators can be seen below.<jupyter_code>name = "<NAME>"
if 'Neural' in name:
  print("Specified name contains the word 'Neural' ")

if 'EHB' not in name:
  print("Specified name does not contain the word 'EHB' ")<jupyter_output>Specified name contains the word 'Neural' 
Specified name does not contain the word 'EHB'
{'fraction_non_alphanumeric': 0.09599602089032579, 'fraction_numerical': 0.02636160159164387, 'mean_word_length': 4.502051983584131, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '631477', 'license': 'MIT', 'n_tokens_mistral': 1298, 'n_tokens_neox': 1186, 'n_words': 550, 'path': 'HW1_ANN.ipynb', 'repo_name': 'Permanganant/EHB-424E---Artificial-Neural-Networks-', 'size': '4053'}