Home

Solution For <a href="Practice_code1.html">Code Practice 1</a>

IN [1]

# Question 1
print('Hello World')

stdout

Hello World

IN [2]

# Question 2
name = input('Enter your name\n')
print(name)
# Input: Prabhu

stdin

Enter your name
 Prabhu

stdout

Prabhu

IN [3]

# Question 3
name = input('Enter Your name\n')
age = int(input('Enter your age\n'))
print(name)
print(age)
# Input: Chandru
# 19

stdin

Enter Your name
 Chandru
Enter your age
 19

stdout

Chandru
19

IN [4]

# Question 4
a = int(input())
b=int(input())
print(a+b)

# Input:
# 10
# 12

stdin

 10
 12

stdout

22

IN [5]

# Question 5
a = int(input())
b = int(input())
print(a+b)
print(a-b)
print(a*b)
print(a/b)
print(a//b)
print(a%b)
print(a**b)

# Input: 14
# 12

stdin

 14
 12

stdout

26
2
168
1.1666666666666667
1
2
56693912375296

IN [6]

# Question 6
a = int(input())
b = int(input())
print('Sum of',a,'and',b,'is',a+b)
print('Sum of %d and %d is %d'%(a,b,a+b))
print('Sum of {} and {} is {}'.format(a,b,a+b))
print(f'Sum of {a} and {b} is {a+b}')

# Input: 10
# 15

stdin

 10
 15

stdout

Sum of 10 and 15 is 25
Sum of 10 and 15 is 25
Sum of 10 and 15 is 25
Sum of 10 and 15 is 25

IN [7]

# Question 7
name = input()
print(f'Good Morning, {name}')

# Input: Jenyhin

stdin

 Jenyhin

stdout

Good Morning, Jenyhin

IN [1]

# Question 8
side = int(input())
print(4 * side)

# Input: 4

stdin

 4

stdout

16

IN [2]

# Question 9
side = int(input())
print(side * side)

# Input: 22

stdin

 22

stdout

484

IN [3]

# Question 10
length = int(input())
breadth = int(input())
print(2 * (length + breadth))

# Input: 22
# 21

stdin

 22
 21

stdout

86

IN [4]

# Question 11
length = int(input())
breadth = int(input())
print(length * breadth)

# Input: 22
# 21

stdin

 22
 21

stdout

462

IN [5]

# Question 12
number_of_sides = int(input())
side = int(input())
print(side * number_of_sides)

# Input: 7
# 21

stdin

 7
 21

stdout

147

IN [6]

# Question 13
base = int(input())
height = int(input())
print(0.5 * base * height)

# Input: 22
# 21

stdin

 22
 21

stdout

231.0

IN [7]

# Question 14
radius = int(input())
print(f'{2 * 3.14159 * radius: .3f}')

# Input:  22

stdin

 22

stdout

 138.230

IN [9]

# Question 15
radius = int(input())
print(f'{3.14159 * radius * radius: .3f}')

# Input: 21

stdin

 21

stdout

 1385.441

IN [11]

# Question 16
a = int(input())
b = int(input())
c = int(input())
s = (a + b + c)/2
print(f'{ (s * (s-a) * (s-b) * (s-c))**0.5: .3f}')

# Input: 3
# 4
# 5

stdin

 3
 4
 5

stdout

 6.000

IN [12]

# Question 17
side = int(input())
print(f'{ 3**0.5 * side * side / 4: .4f}')
# Input: 31

stdin

 31

stdout

 416.1252

IN [13]

# Question 18
base = int(input())
height = int(input())
print(f'{(base**2 + height**2)**0.5: .3f}')

# Input: 12
# 6

stdin

 12
 6

stdout

 13.416

IN [14]

# Question 19 
side = int(input())
print(side ** 3)

# Input: 15

stdin

 15

stdout

3375

IN [15]

# Question 20
side = int(input()) 
print(6 * side ** 2)

# Input: 15

stdin

 15

stdout

1350

IN [16]

# Question 21
length = int(input()) 
breadth = int(input()) 
height = int(input()) 
print(length*breadth*height)

# Input: 43
# 28
# 35

stdin

 43
 28
 35

stdout

42140

IN [17]

# Question 22
l = int(input()) 
b = int(input()) 
h = int(input()) 
tsa = 2 * (l * b + b * h + h * l)
print(tsa)

# Input: 43
# 28
# 35

stdin

 43
 28
 35

stdout

7378

IN [None]