Python Programming Procedural - Ba (Gad)_r22_supple-1
Python Programming Procedural - Ba (Gad)_r22_supple-1
7GP
1. Write a python program which reads n values into a list and performs the following
operations.
2. Write a program which reads n values and print the all possible patterns by perform-
ing left circular shift.
5. Write a Python Program to read two text files one after the other and write the con-
tents to third file.
```python
values.insert(position, value_to_insert)
# ii. Find third largest value
third_largest = sorted(set(values))[-3]
```
```python
for i in range(n):
print(values[i:] + values[:i])
```
```python
import cmath
a = float(input("Enter a: "))
b = float(input("Enter b: "))
c = float(input("Enter c: "))
d = (b**2) - (4*a*c)
```
```python
def insertion_sort(arr):
key = arr[i]
j=i-1
arr[j + 1] = arr[j]
j -= 1
arr[j + 1] = key
insertion_sort(values)
```
```python
with open('file1.txt', 'r') as f1, open('file2.txt', 'r') as f2, open('file3.txt', 'w') as f3:
f3.write(f1.read())
f3.write(f2.read())
```
Viva-voce: 20 Marks
***