<jupyter_start><jupyter_text>practisepython.org<jupyter_code>print('Enter your name and Age one by one')

# data input

data_list = [input() for i in range(2)]


year = 2019+(100 - int(data_list[1]))

print('Hello {}, wish you can celebrate your 100th birthday on {}'.format(data_list[0], year))
# Alternate

input_list = input().split(',')

year = 2019+(100 - int(input_list[1]))

print('Hello {}, wish you can celebrate your 100th birthday on {}'.format(input_list[0], year))
# Exercise 2 
# find odd or even

num = int(input('Enter a number:'))

if num%2 == 0:
    print(' You are more of an even person')
else:
    print('Your way of thinking is odd')
# numbers less than five

def less_than_five (list1):
    
    newlist = []
    for num in list1:
        if num < 5:
            newlist.append(num)
    return newlist
            
list1 = [23,6,7788,4,5,3,2,1,2,6,78,99]

less_than_five(list1)
# Using Lambda and filter

#myList = list(filter(lambda num: num<5, list1))

print(list(filter(lambda num: num<5, list1)))

# prgrm to print out all the divisors of a number

number = int(input('Enter a number'))

myList = []
for num in range(1,number):
    if number%num == 0:
        myList.append(num)

print(myList)
# Some randon practice
import random

res = []

for i in range(7):
    res.append(random.randrange(1,50,1))
    
print('Random number list is: '+ str(res))
res = [random.randrange(1,50,1) for i in range(7)]
print('Random number list is: '+ str(res))
import random
# MATCHING LISTS

list1 = [random.randrange(1,30,1) for i in range(10)]
list2 = [random.randrange(1,30,1) for i in range(10)]

print( list1, list2)

res = [num for num in list1 if num in list2]


print(res)
res = []
for num in list1:
    if num in list2:
        res.append(num)
#res = []
#for num in list1:
 #   if num in list2:
  #      res.append(num)
def front_back (str):
    n = len(str)
    if n == 1:
        return str
    return str[n-1] + str[1:(n-1)] + str[0]
front_back('book')
front_back('code')<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup