-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPF_LAB7.py
More file actions
61 lines (53 loc) · 1.49 KB
/
PF_LAB7.py
File metadata and controls
61 lines (53 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# PROGRAM 4
# tup1 = ('U', 'I', 'T', 2, 0, 1, 8, 'b', 'a', 't', 'c', 'h')
# print(tup1[3])
# print(tup1[-4])
# PROGRAMMING EXERCISE
# QUESTION 1
# import math
# sample = [(2, 3), (4, 7), (8, 11), (3, 6)]
# n = 1
# for i in sample:
# print(f"The minimum value of element {n} = {min(i)}")
# print(f"The maximum value of element {n} = {max(i)}")
# n += 1
# QUESTION 2
# def dart_hits(x, y):
# r = 10
# return (x**2 + y**2) <= r**2
# coordinates = [(0, 0), (10, 10), (6, 6), (7, 8)]
# for i, j in coordinates:
# result = dart_hits(i, j)
# if result:
# print(f"{result} -Dart at {i, j} hits the board")
# else:
# print(f"{result} -Dart at {i, j} misses the board")
# QUESTION 3
# a = len('anachronistically') == len('counterintuitive') + 1
# b = 'misinterpretation' < 'misrepresentation'
# c = 'e' not in 'floccinaucinihilipilification'
# d = len('counterrevolution') == len('counter') + len('resolution')
# print(a)
# print(b)
# print(c)
# print(d)
# QUESTION 4
# provinces = ()
# p = list(input('Enter provinces of Pakistan : ').split())
# provinces = tuple(p)
# print(provinces)
# QUESTION 5
# monthsL = ['Jan', 'Feb', 'Mar', 'May']
# monthsT = ('Jan', 'Feb', 'Mar', 'May')
# monthsL.insert(3, 'Apr')
# monthsT.insert(3, 'Apr')
# monthsL.append('Jun')
# monthsT.append('Jun')
# monthsL.pop()
# monthsT.pop()
# monthsL.pop(1)
# monthsT.pop(1)
# monthsL.reverse()
# monthsT.reverse()
# print(monthsL)
# print(monthsT)