<jupyter_start><jupyter_text>No.1 Python program to split a variable length string into variables.<jupyter_code>var_list = ['a', 'b', 'c']
x, y, z = (var_list + [None] * 3)[:3]
print(x, y, z)
var_list = [100, 20.25]
x, y = (var_list + [None] * 2)[:2]
print(x, y)<jupyter_output><empty_output><jupyter_text>No.2 Python program to list home directory without absolute path.<jupyter_code>import os.path

print(os.path.expanduser('~'))<jupyter_output><empty_output><jupyter_text>No.3 Python program to calculate the time runs (difference between start and current time) of a program.<jupyter_code>from timeit import default_timer
def timer(n):
    start = default_timer()
    for row in range(0, n):
        print(row)
    print(default_timer() - start)
timer(5)
timer(15)<jupyter_output><empty_output><jupyter_text>No.4 Python program to input two integers in a single line.<jupyter_code>print("Input the value of x & y")
x, y = map(int, input().split())
print("The value of x & y are: ",x,y)<jupyter_output><empty_output><jupyter_text>No.5 Python program to print a variable without spaces between values. Sample value : x =30 Expected output : Value of x is "30"<jupyter_code>x = 30
print("Value of x is \"{}\"".format(x))<jupyter_output><empty_output><jupyter_text>No.6 Python program to find files and skip directories of a given directory.<jupyter_code>import os
print([f for f in os.listdir('/Desktop/AniyomEbenezer') if os.path.isfile(os.path.join('/Desktop/AniyomEbenezer', f))])<jupyter_output><empty_output><jupyter_text>No.7 Python program to extract single key-value pair of a dictionary in variables.<jupyter_code>d = {'Red': 'Green'}
(c1, c2), = d.items()
print(c1)
print(c2)<jupyter_output><empty_output><jupyter_text>No.8 Python program to convert true to 1 and false to 0.<jupyter_code>x = "true"
x = int(x == "true")
print(x)
x = "eben"
x = int(x == "true")
print(x)<jupyter_output><empty_output><jupyter_text>No.9 Python program to valid a IP address.<jupyter_code>import socket
addr = '127.0.0.2561'
try:
    socket.inet_aton(addr)
    print("Valid IP")
except socket.error:
    print("Invalid IP")
	
    
#reference: w3resource<jupyter_output><empty_output><jupyter_text>No.10 Write a Python program to convert an integer to binary keep leading zeros. Sample data : 50 Expected output : 00001100, 0000001100<jupyter_code>x = 12
print(format(x, "08b"))
print(format(x, "010b"))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13696369636963696, 'fraction_numerical': 0.03094059405940594, 'mean_word_length': 5.928571428571429, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '10', 'dir': 'jupyter-structured-clean-dedup', 'id': '125184', 'license': 'MIT', 'n_tokens_mistral': 927, 'n_tokens_neox': 872, 'n_words': 237, 'path': 'Aniyom Ebenezer/phase 1/python 1 basis/Day_15_Challenge_Solutionn.ipynb', 'repo_name': 'elifbayindir/python-challenge-solutions', 'size': '2424'}