Professional Documents
Culture Documents
Python Module 1 2 3 CIE 1 Complete Solutions
Python Module 1 2 3 CIE 1 Complete Solutions
PART-(A)
(1) List the features of Python Programming language?
(c)Object-Oriented Language
(e)dynamically types
(f)platform independent
(g)portable
-------------------------------------------------------------------------------------------------------------------------------------
First and foremost reason why Python is much popular because it is highly productive as compared
to other programming languages like C++ and Java. ... Python is also very famous for its simple
programming syntax, code readability and English-like commands that make coding in Python lot
easier and efficient.
Python is a general purpose programming language. Hence, you can use the programming language
for developing both desktop and web applications. Also, you can use Python for developing complex
scientific and numeric applications. Python is designed with features to facilitate data analysis and
visualization.
The python language is one of the most accessible programming languages available because it has
simplified syntax and not complicated, which gives more emphasis on natural language. Due to its
ease of learning and usage, python codes can be easily written and executed much faster than other
programming languages.
------------------------------------------------------------------------------------------------------------------------------------ --
Web Development. Python can be used to make web-applications at a rapid rate. ...
Game Development. Python is also used in the development of interactive games. ...
Machine Learning and Artificial Intelligence. ..Data Science and Data Visualization. ..
Desktop GUI. ..
#OR
#OR
Language Development.
----------------------------------------------------------------------------------------------------------------------------------- ---
No compiler is required
Python supports both procedure oriented and object oriented programming which is one of the key
python features.
-------------------------------------------------------------------------------------------------------------------------------------
ii. 7 % 7 + 7 // 7 -7 * 7
(A)
(i) 64//8%2
=8%2=0
--------------------------------------------------------------------------------------------------------------------------------------
i. hELLO
ii. 2020_Dec
iii. _basic
iv. basic-hra
v. #xyz
(A)
----------------------------------------------------------------------------------------------------------------------------- ---------
ii. round(20.644336,2)
iii. pow(2,5)
iv. bin(15)
v. int(-3.33)
(A)
(i). 5
(ii). 20.64
(iii)32
(v). -3
i .11(12+13)
ii. (5*6)(7+8)
iii. 4*(3-2)
iv. 5***3
(A)
(i) wrong because there is no * and the system wont understand that we should multiply it.
(ii)(5*6)(7+8)= (30)(15)→ wrong because the system dosent know what to do after this as * is not
mentioned.
(iii)4*(3-2)= 4*1=4
----------------------------------------------------------------------------------------------------------------------------- ---------
(10)
To be discussed later.
i. trunc(-2.8)
ii. floor(-0.5)
iii. ceil(0.2)
(A)
(i). trunc(x) - removes all the trailing decimal places in x. It just removes all the decimals.
Import math
trunc(-2.8)= -2
(ii) floor(x) - rounds number to the next lowest integer import math
Import math
math.floor(-0.5)=-1
Import math
math.ceil(0.2)=1
(12) s='Python@123'
i. print(s.isalpha()-False
ii. print(s.islower())-False
iii. print(s.isupper())-False
iv. print(s.isdigit())-False
--------------------------------------------------------------------------------------------------------------------------------------
#13-
'''str ='Hello'
print(str[0])#H
print(str[4])#o
print(str[-0])#H
print(str[-5])#o
print(str[-1])#o'''
----------------------------------------------------------------------------------------------------------------------------- ---------
#14-
'''Str='Welcome to IARE'
print(Str[3:100])#come to IARE
print(Str[4:])#ome to IARE
----------------------------------------------------------------------------------------------------------------------------- ---------
#15-
'''print('e' in 'Hello')#True
print('z' in 'Hello')#False
print('lo' in 'Hello')#True'''
-------------------------------------------------------------------------------------------------------------------------------- ------
#16-
'''a=10
b=12
c=0
----------------------------------------------------------------------------------------------------------------------------- --------
#17-
print(ch)
print(ch.add('hai'))#none
print(ch.remove('H'))#none
print(ch.clear())#none'''
----------------------------------------------------------------------------------------------------------------------------- ---------
#18-
'''lst1=[10,20,30,40,50]
print(lst1.append(60))#none
print(lst1.pop())#60
print(lst1.pop(3))#40
print(lst1.insert(3,45))#none'''
----------------------------------------------------------------------------------------------------------------------------- ---------
#19-
print(d1.keys())#dict_keys(['Mango', 'Guava'])
print(d1.values())#dict_values([30, 20])
print(d1.clear())#none'''
----------------------------------------------------------------------------------------------------------------------------- ---------
#20-
'''t1=tuple('HYD')
print(t1[-1])#D
---------------------------------------------------------------END OF part(A)--------------------------------------------
PART(B)
1. Write the features and applications of Python programming language
Features in Python:-
a. Easy to code: Python is a high-level programming language
b. Free and Open Source
c. Object-Oriented Language
d. GUI Programming Support
e. High-Level Language
f. Extensible feature
g. Python is Portable language
h. Python is Integrated language
------------------------------------------------------------------------------------------------------------
2. List the various operators supported in Python?
Python language supports the following types of operators.
a. Arithmetic Operators.
b. Comparison (Relational) Operators.
c. Assignment Operators.
d. Logical Operators.
e. Bitwise Operators.
f. Membership Operators.
g. Identity Operators
----------------------------------------------------------------------------------------------------------------------------- ---------
5. #amount of grosssalary
basic_salary=int(input("enter basic salary:"))
DA=40/100*basic_salary
print('DA',DA)
HRA=20/100*basic_salary#HRA=house rent allowance
print('HRA',HRA)
gross_salary=basic_salary+DA+HRA
print('GROSS_SALARY',gross_salary)
----------------------------------------------------------------------------------------------------------------
list1=[1,2,3,4,5]
list2=[6,7,8,9]
if item in list2:
print("overlapping")
else:
print("not overlapping")
Output:
not overlapping
Same example without using in operator:
def overlapping(list1,list2):
c=0
d=0
for i in list1:
c+=1
for i in list2:
d+=1
for i in range(0,c):
for j in range(0,d):
if(list1[i]==list2[j]):
return 1
return 0
list1=[1,2,3,4,5]
list2=[6,7,8,9]
if(overlapping(list1,list2)):
print("overlapping")
else:
print("not overlapping")
Output:
not overlapping
1. ‘not in’ operator- Evaluates to true if it does not find a variable in the
specified sequence and false otherwise
x = 24
y = 20
if ( x not in list ):
else:
if ( y in list ):
else:
print("y is NOT present in given list")
x =5
if (type(x) is int):
print("true")
else:
print("false")
Output:
True
x = 5.2
else:
print("false")
Output:
True
----------------------------------------------------------------------------------------------------------------
Scalar Types
• int: Positive or negative whole numbers (without a fractional part) e.g. -10, 10, 456,
4654654.
• float: Any real number with a floating-point representation in which a fractional
component is denoted by a decimal symbol or scientific notation e.g. 1.23,
3.4556789e2.
• complex: A number with a real and imaginary component represented as x + 2y.
• bool: Data with one of two built-in values True or False. Notice that 'T' and 'F' are
capital. true and false are not valid booleans and Python will throw an error for
them.
• None: The None represents the null object in Python. A None is returned by
functions that don't explicitly return a value.
Sequence Type
A sequence is an ordered collection of similar or different data types. Python has the
following built-in sequence data types:
• String: A string value is a collection of one or more characters put in single, double or
triple quotes.
• List: A list object is an ordered collection of one or more data items, not necessarily
of the same type, put in square brackets.
• Tuple: A Tuple object is an ordered collection of one or more data items, not
necessarily of the same type, put in parentheses.
Mapping Type
Dictionary: A dictionary Dict() object is an unordered collection of data in a
key:value pair form. A collection of such pairs is enclosed in curly brackets. For
example: {1:"Steve", 2:"Bill", 3:"Ram", 4: "Farha"}
Set Types
• set: Set is mutable, unordered collection of distinct hashable objects. The set is a
Python implementation of the set in Mathematics. A set object has suitable methods to
perform mathematical set operations like union, intersection, difference, etc.
• frozenset: Frozenset is immutable version of set whose elements are added from other
iterables.
Numbers, strings, and Tuples are immutable, which means their contents can't be
altered after creation.
On the other hand, items in a List or Dictionary object can be modified. It is possible
to add, delete, insert, and rearrange items in a list or dictionary. Hence, they are
mutable objects.
----------------------------------------------------------------------------------------------------------------
10) Momentum is calculated as e = mc2 , where m is the mass of the object and c is its velocity.
Write a program that accepts an object‟s mass (in kilogram) and velocity (in meters per second) and
displays its momentum?
, where m is
----------------------------------------------------------------------------------------------------------------
seconds=a*24*60*60
----------------------------------------------------------------------------------------------------------------
(12) Write a program that prompts the user to enter the first name and the last name. Then display
the following message.
Welcome to Python!
print("Hello",a)
print("Welcome to Python!")
----------------------------------------------------------------------------------------------------------------
x=0
y=0
for i in address:
x+=1
if i==",":
if address[y]==' ' and y!=0:
listed=address[y+1:x]
else:
listed=address[y:x]
y=x
print(listed)
l=len(address)
if address[y]==' ':
print(address[y+1:l])
else:
print(address[y:l])
----------------------------------------------------------------------------------------------------------------
14)BITWISE OPERATORS:
| Bitwise OR x|y
~ Bitwise NOT ~x
Answer: #to find the total amoit of money in a piggy bank,given the coins of rs100,rs50,rs20&rs10
total=int
total=100*rs100+50*rs50+20*rs20+10*rs10
print("total money:",total)
----------------------------------------------------------------------------------------------------------------
Answer: Rules for an identifier: indentifier can be a combination of letters in lowercase or uppercase
or digits or an underscore_.
n=int(input("give me a number:"))
print(n)
----------------------------------------------------------------------------------------------------------------
18. Write a program to enter a number and display its
root?
import math
print(round(math.sqrt(n),2))
----------------------------------------------------------------------------------------------------------------
i. abs()
ii. pow()
iii. mean()
iv. max()
v. divmod()
1. absolute
2. power
3. mean
4. max
5. divmod
''')
import statistics
if choice == 1:
print(abs(number))
if choice == 2:
print(pow(number,number2))
if choice == 3:
lst = []
for i in range(items):
item = int(input())
lst.append(item)
print(statistics.mean(lst))
if choice == 4:
print(max(number,number2))
if choice == 5:
result = divmod(number,number2)
else:
----------------------------------------------------------------------------------------------------------------
operations
i. Convert binary '1100001110' into
decimal int
string
decimal 34567
print(int('1100001110',2))
print(str(4.33))
print(29//5)
print(29%5)
print(hex(34567))
PART(C):
1) The provided code stub reads two integers from STDIN, a and b, write a Python program to print
three lines where: i. The first line contains the sum of the two numbers. ii. The second line contains
the difference of the two numbers (first - second). iii. The third line contains the product of the two
numbers.
(A)
a=int(input('enter the number' ))
b=int(input('enter the second number'))
(adding of two numbers)
c=a+b
print(c)
(subtracting two numbers)
d=a-b
print(d)
(product of two numbers)
e=a*b
print(e)
----------------------------------------------------------------------------------------------------------------
(2) The provided code stub will read in a dictionary containing key/value pairs of name:[marks] for a
list of students. Print the average of the marks array for the student name provided, showing 2
places after the decimal
(A)
n = int(input('Enter the number of values to be added: '))
dict_marks = {}
total = 0
status = 1
average = 0
for _ in range(n):
lst = []
name_marks = input().split()
for items in range(1,len(name_marks)):
lst.append(int(name_marks[items]))
dict_marks.update({name_marks[0].lower() : lst})
if choice in dict_marks.keys():
student_name = dict_marks[choice]
for item in student_name:
if item>=0 and item<=100:
total += item
else:
print('Marks cannot less than 0 or greater than 100')
status = -1
break
average = total/len(student_name)
else:
print(f"{choice} doesn't exist")
if status == 1:
print("%.2f"%average)
else:
print(f'Program exited with status code {status}')
----------------------------------------------------------------------------------------------------------------
(3) Given the participants' score sheet for your University Sports Day, you are required to find the
runner-up score. You are given n scores. Store them in a list and find the score of the runner-up.
(A)
n=len(b) #5
b.sort() #2 3 5 6 6
c=set(b) # {2 3 5 6 }
d=list(c) #[ 2 3 5 6]
print(d[n-2]) #5
----------------------------------------------------------------------------------------------------------------
(A)
a=input()
for i in a:
if i.isupper():
i=i.lower()
print(i, end="")
elif i.islower():
i=i.upper()
print(i, end="")
else:
print(i, end="")
------------------------------------------------------------------------------------------------------------------ --------------------
following commands:
integer e.
list.
(A)
lst = []
if n>0:
i =0
while i < n :
choice = input().split()
operation = choice[0].lower()
if operation == 'append':
value = int(choice[1])
lst.append(value)
elif operation == 'insert':
index = int(choice[1])
value = int(choice[2])
lst.insert(index,value)
lst.pop()
print(lst)
lst.sort()
lst.reverse()
value = int(choice[1])
lst.remove(value)
else:
print('Invalid operation')
i -= 1
i += 1
else:
w=i or j or k
y=i or j and k
z=i and j or k
print(w,x,y,z)
(A)
OUTPUT:
4 0 4 -1
----------------------------------------------------------------------------------------------------------------------------- ---------
(A)
OUTPUT:
True
----------------------------------------------------------------------------------------------------------------------------- ---------
(A) The above code is wrong as it has conditions after else. However, if we fix it by
replacing else with elif, the output is biggest = 45
--------------------------------------------------------------------------------------------------------------------------------------
(A)
OUTPUT:
500
----------------------------------------------------------------------------------------------------------------------------- ---------
(A)
OUTPUT:
Hello
----------------------------------------------------------------------------------------------------------------------------- ---------
(A)
OUTPUT:
Hi
----------------------------------------------------------------------------------------------------------------------------- ---------
(A)
OUTPUT:
Hi
----------------------------------------------------------------------------------------------------------------------------- ---------
(A)OUTPUT:
Hi
----------------------------------------------------------------------------------------------------------------------------- ---------
(A)
OUTPUT:
Hi
----------------------------------------------------------------------------------------------------------------------------- ---------
(A)It isn’t a=b, as = is an assigning operation. The solution is a==b,which is the equality operator.
----------------------------------------------------------------------------------------------------------------------------- ---------
The error here is after the if condition there should be a colon or else
it gives you indentation error.
--------------------------------------------------------------------------------------------------------------------------------------
x = 10 ; y = 15
if x >= 2 then
print(„x‟)
(A)
print('x')
----------------------------------------------------------------------------------------------------------------------------- ---------
x = 10 ; y = 15 if x % 2 = y % 3
print(„Carpathians\n‟)
#ERROR
x=10
y=15
if x%2==y%3:
print("yes")
----------------------------------------------------------------------------------------------------------------------------- ---------
(A)
The error in the code is with decision statements. The above code contains elseif
instead of elif.
----------------------------------------------------------------------------------------------------------------------------- ---------
x = 3 y = 3.0
if x == y ;
else :
(A)
x=3
y = 3.0
if x == y :
else :
'''
'''
x=3
y = 3.0
result = 'x and y are equal' if x == y else 'x and y are not equal'
print(result)
------------------------------------------------------------------------------------------------------------------------------------ --
(A)
The range() function returns a sequence of numbers, starting from 0 by
default, and increments by 1 (by default), and stops before a specified
number.
range(start, stop, step)
x = range(3, 6)
for n in x:
print(n)
----------------------------------------------------------------------------------------------------------------------------- ---------
(A)
--------------------------------------------------------------------------------------------------------------------------------------
(A)
The pass statement is used as a placeholder for future code. When the pass
statement is executed, nothing happens, but you avoid getting an error when empty
code is not allowed. Empty code is not allowed in loops, function definitions, class
definitions, or in if statements.
--------------------------------------------------------------------------------------------------------------------------------------
(A)
for i in range(11,0,-1):
print(i)
----------------------------------------------------------------------------------------------------------------
20. Write a program to display the elements of a list using for loop?
(A)
a = [1, 2,3,4,5]
for x in range(len(a)):
print(a[x])
PART-B
1. Explain the decision control statements in Python?
(A)
Python, like many other computer programming languages, uses Boolean logic for its decision
control. That is, the Python interpreter compares one or more values in order to decide whether
to execute a piece of code or not, given the proper syntax and instructions.
Decision control is then divided into two major categories, conditional and repetition. Conditional
logic simply uses the keyword if and a Boolean expression to decide whether or not to execute a
code block. Repetition builds on the conditional constructs by giving us a simple method in which
to repeat a block of code while a Boolean expression evaluates to true.
----------------------------------------------------------------------------------------------------------------------------- ---------
(A)
character = input()
lower_case_character = character.lower()
if len(character)>1:
else:
print('Vowel')
else:
print('Consonant')
----------------------------------------------------------------------------------------------------------------------------- ---------
(3) Write a program to find the greatest number from three numbers?
(A)
a=int(input())
b=int(input())
c=int(input())
print(a)
print(b)
else:
print(c)
----------------------------------------------------------------------------------------------------------------------------- ---------
(A)
if a<150000:
print('no tax')
if 150001<a<300000:
if 300001<a<500000:
if a>500001:
print('your tax is ',0.3*a)
----------------------------------------------------------------------------------------------------------------------------- ---------
(5) Write a program to enter the marks of a student in four subjects. Then calculate the total and
aggregate, and display the grade obtained by the student.
i. If the student scores an aggregate greater than 75%, then the grade is distinction.
v.else,grade is fail.
(A)
lac=int(input())
bee=int(input())
pp=int(input())
che=int(input())
total=lac+bee+pp+che
agg=(total/400)*100
print(agg)
if agg>75:
if 60<=agg<75:
if 50<=agg<60:
if 40<=agg<50:
if agg<40:
print('Fail')
----------------------------------------------------------------------------------------------------------------------------- ---------
Syntax:
Inislization
while condition:
statement(s)
increment/decrement
Example:
i=1
while i<6:
print(i)
i+=1
else:
for loop: It can be used to iterate over a list /string/dictionary or iterate over a range of
numbers.
Syntax:
statements
Example:
for x in range(1,5)
print(x)
output;1
Adj=[‘red’,’big’,’tasty’]
Fruits=[‘apple’,’banana’,’cherry’]
for x in adj:
for y in fruits:
print(x,y)
Output:
red apple
red banana
red cherry
big apple
big banana
big cherry
tasty apple
tasty banana
tasty cherry
----------------------------------------------------------------------------------------------------------------------------- ---------
(8) Write a program to read the numbers until -1 is encountered. Also count the negative, positives
and zeros entered by the user.
----------------------------------------------------------------------------------------------------------------------------- ---------
(9) Write a program to calculate the LCM and GCD of two numbers.
(A)
print(gcd)#2
print(int(lcm))#6
fm=[]
for i in range(1,a[0]+1):#(1,3)
if a[0]%i==0:
fm.append(i)#[1,2]
print(fm)
fn=[]
for i in range(1,a[1]+1):#(1,7)
if a[1]%i==0:
fn.append(i)#(1,2,3,6)
print(fn)
cf=[]
for k in fm:
if k in fn:
cf.append(k)#[1,2]
print(cf)
gcd=cf[-1]#2
lcm=(a[0]*a[1])/gcd#2*6/2=6
print(gcd)#2
print(int(lcm))#6
--------------------------------------------------------------------------------------------------------------------------------------
11) Write a program to read a number and then calculate the sum of its digits?
(A)
n=int(input())
sum = 0
while (n != 0):
n = n//10
print(sum)
----------------------------------------------------------------------------------------------------------------------------- ---------
(12) Write a program to calculate the average of first n natural numbers using for loop?
total_sum=0
for n in range(num):
total_sum += numbers
avg = total_sum/num
----------------------------------------------------------------------------------------------------------------------------- ---------
13. Write a program using for loop to print all the numbers from m to n thereby classifying them as
even or odd?
(A)
m=int(input())
n=int(input())
tem=m
while m<=n:
if m%2==0:
m+=2
m+=2
else:
break
m=tem
print("\nodd numbers are ", end="")
while m<=n:
if m%2!=0:
m+=2
m+=2
METHOD-2:
m=int(input())
n=int(input())
even=[]
odd=[]
for i in range(m,n+1):
if i%2==0:
even.append(i)
else:
odd.append(i)
METHOD-3:
m=int(input())
n=int(input())
if i%2==0:
if i%2!=0:
--------------------------------------------------------------------------------------------------------- -----------------------------
prime or not?
(A)
a=int(input())
b=1
c=0
while b<(a/2):
b+=1
if a%b==0:
c=1
if a==1:
elif c==0:
print("Prime Number")
else:
print("Composite Number")
METHOD-2:
a=int(input())
for i in range(2,a):
if a%i==0:
break
else:
print("it is a prime")
------------------------------------------------------------------------------------------------------------------ --------------------
(A)
n=int(input())
i=1
tot=0
while i<=n:
x=i+1
y=i/x
tot=tot+y
i+=1
print(tot)
------------------------------------------------------------------------------------------------------------------ --------------------
(16)Write a program to find the sum of the series –1/1 + 2^2/2 + 3^3/3+ …..+ n2/n
(A)
n=int(input())
tot=0
i=1
while i<=n:
x=i**2
y=x/i
tot=tot+y
i+=1
print(tot)
----------------------------------------------------------------------------------------------------------------------------- ---------
(17) Write a program to generate the calendar of a month given the start_day and the number of
days in that month?
----------------------------------------------------------------------------------------------------------------------------- ---------
----------------------------------------------------------------------------------------------------------------------------- ---------
19.
12
345
6789
'''
(A)
n=int(input())
count = 0
count +=1
print('')
--------------------------------------------------------------------------------------------------------------------------------------
20.
22
333
4444
'''
(A) n=int(input())
for i in range(1,n):
for j in range(1,i+1):
print('')
----------------------------------------------------------------------------------------------------------------------------- ---------
PART(C)
(1)
number.
(A)
lst_num = list(str(n))
swapped_number = 0
last_element_index = len(lst_num) - 1
print(swapped_number)
----------------------------------------------------------------------------------------------------------------------------- ---------
a=int(input())
digits=[]
while a>0:
digits.append(a%10)
a=a//10
i=0
while i<10:
frequency=0
for x in digits:
if i==x:
frequency+=1
i+=1
----------------------------------------------------------------------------------------------------------------------------- ---------
(A)
for i in range(rows):
for j in range(columns):
print()
--------------------------------------------------------------------------------------------------------------------------------------
(4) Write a Python program to print the given number pattern series of 1's and 0's at alternate
columns using loop
(A)
if(j % 2 == 0):
print('0',end='')
else:
print('1',end='')
print()
----------------------------------------------------------------------------------------------------------------------------- ---------
(5) Write a Python program to print inverted right triangle star pattern series using for loop.
(A)
n=int(input())
for i in range(n+1,0,-1):
print('*'*(i-1))
-----------------------------------------------END OF PART(C)----------------------------------------------------------------
------------------------------------------------END OF MODULE 2------------------------------------------------------------
MODULE 3
PARTA
#1
print(Lst[2:5]) #[3, 4, 5]
print(Lst[::2]) #[1, 3, 5, 7, 9]
print(Lst[1::3]) #[2, 5, 8]
----------------------------------------------------------------------------------------------------------------------------- ---------
#2
Lst2 = Lst1
Lst3 = Lst1[2:6]
print(Lst3) #[3, 4, 5, 6]
----------------------------------------------------------------------------------------------------------------------------- ---------
#3
'''Lst1 = [6, 3, 7, 0, 1, 2, 4, 9]
print(min(Lst1)) #0
print(sum(Lst1)) #32
print(len(Lst1)) #8
print(all(Lst1)) #False
print(any(Lst1)) #True'''
----------------------------------------------------------------------------------------------------------------------------- ---------
#4
'''Lst1 = [6, 3, 7, 0, 1, 2, 4, 9]
print(Lst1.append(10)) #[6,3,7,0,1,2,4,9,10]
print(Lst1.count(4)) #1
print(Lst1.pop()) #10'''
----------------------------------------------------------------------------------------------------------------------------- ---------
#5
'''Lst1 = [6, 3, 7, 0, 1, 2, 4, 9]
print(Lst1.sort()) #[0,1,2,3,4,5,6,7,9]
print(Lst1.extend(Lst2)) #[0,1,2,3,4,6,7,9,6,7,8,9,10]
print(Lst1.reverse()) #[9, 4, 2, 1, 0, 7, 3, 6]
print(Lst1.remove(0)''' #[6, 3, 7, 1, 2, 4, 9]
----------------------------------------------------------------------------------------------------------------------------- ---------
#6
----------------------------------------------------------------------------------------------------------------------------- ---------
#7
T[2][0] = 5
--------------------------------------------------------------------------------------------------------------------------------------
#8
T2 = T1, (5, 6, 7, 8)
--------------------------------------------------------------------------------------------------------------------------------------
#9
L = [1, 'abc']
print(T == L) #false
print(list(T) == L) #true'''
--------------------------------------------------------------------------------------------------------------------------------------
#10
(key, value) = t
----------------------------------------------------------------------------------------------------------------------------- ---------