You are on page 1of 4

print("QUESTION 1")

name = input("Enter your name: ")

print("My names is:", name)

print("QUESTION 2")

mydetails_dictionary = {"name":"Aish NnaNna Abdulkadir","program":"higher national


diploma","RegNum":"KPT/ODfel/CST/22/095","Depatment":"computerScience","Level":300,"Lecturer
Name":"Dr Naseer Ajoge"}

print("##########################################")

for keys , number in mydetails_dictionary.items():

print(f'{keys} is {number}')

print(mydetails_dictionary)

list1 =[5,1,2,3]

print(len(list1))

list2 = [-1,3,6,7,8,1]

print(len(list2))

print("QUESTION 3")

firstList = len(list1)

secondList = len(list2)

if(firstList > secondList):

print("List1 has a max numbers of element")

else:

print("List2 has a max number of element")


print("QUESTION 4")

if(len(list1)==0):

print("The list is an empty list")

else:

print("The list is not an empty list")

print("QUESTION 5")

#import numpy as np

#x =np.array([list1])

#y =np.array([list2])

#print(np.intersect1d(x,y))

print("Common element from the two list")

print(list(set(list1).intersection(list2)))

print("QUESTION 6")

roman_dictionary = {1:"i",2:"ii",3:"iii",4:"iv",5:"v"}

if 5 in roman_dictionary:

print("key is present")

print("QUESTION 7")

My_list_Name = ['arike','ade','memuna','aisha','muhammad','ali']

list_name = input(" Enter a name to be search from my list name: ")


if list_name in My_list_Name:

print(f'{list_name} is available in the list name')

else:

print(f'{list_name} is not available in the list name')

print("QUESTION 8")

NEW_LIST = [120,130,140,150,160]

OLD_LIST = [160,40,150]

check= any(item in NEW_LIST for item in OLD_LIST)

print("The NEW_LIST contain items of the old list",check)

print("QUESTION 9")

given_list = [10,1,4,6,7,5,0,2,8]

print("the original list are: ",given_list)

for i in given_list:

if(i%2==0):

given_list.remove(i)

print("The old list after removing the even number: ")

print(given_list)

print("QUESTION 10")
number = int(input("Enter an integer number"))

if (number<1):

print("invalid input")

else:

print(f'The binary equivalent of {number} =', bin(number))

input()

You might also like