ILLUSTRATIVE
PROGRAMS
a =
int(input("Enter a value "))
b =
int(input("Enter b value "))
c = a
a = b
b = c
print("a=",a,"b=",b,)
Output
Enter a value 5
Enter b value 8
a=8
b=5
import math
x1=int(input("enter
x1"))
y1=int(input("enter
y1"))
x2=int(input("enter
x2"))
y2=int(input("enter
y2"))
distance =math.sqrt((x2-x1)**2)+((y2-
y1)**2)
print(distance)
enter x1 7
enter y1 6
enter x2 5
enter y2 7
2.5
a=list(input("enter
the list"))
print(a)
for i in
range(1,len(a),1):
print(a[i:]+a[:i])
enter the list
'1234'
['1', '2', '3',
'4']
['2', '3', '4',
'1']
['3', '4', '1',
'2']
['4', '1', '2',
'3']
Related Topics
Privacy Policy, Terms and Conditions, DMCA Policy and Compliant
Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.