A Practical Introduction To Python Programming v2.0
A Practical Introduction To Python Programming v2.0
Python Programming
(Brian Heinold
Department of Mathematics and Computer Science
Mount St. Marys University)
Solution Manual
Q:7
Solution
x=eval(input('Enter the Weight in Kg: '))
y=x*2.2
print('The weight in Pounds is: ', y)
Q:8
Solution
y=eval(input('Enter the Price of the meal: '))
y1=eval(input('Enter the %age of tip you want to leave: '))
tip=y*(y1/100)
bill=y+tip
print('The amount of bill is',bill,'and the tip is',tip)
Q:2
Solution
for i in range(200):
print('Your Name',end=' ')
Q:3
Solution
for i in range(100):
print(i+1,'Your Name')
Q:4
Solution
for i in range(20):
y=i+1
print(y,y*y)
Q:5
Solution
for i in range(8,90,3):
Q:6
Solution
for i in range(100,1,-2):
print(i)
Q:7
Solution
for i in range(10):
print('A',end='')
for j in range(7):
print('B',end='')
for k in range(4):
print('CD',end='')
print('E',end='')
for l in range(6):
print('F',end='')
print('G',end='')
Q:8
Solution
y=input('Enter Your Name: ')
z=eval(input('Enter the # of times you want to print your Name: '))
for i in range(z):
print(y)
Q:10
Solution
z=eval(input('Specify the width of stars in #:'))
r=eval(input('Specify the height of stars in #: '))
for i in range(r):
print ('*'*z)
Q:11
Solution
a=eval(input('Provide the height of the box: '))
b=eval(input('Provide the width of the box: '))
d=a-2
r=b-2
Q:12
Solution
for i in range(r):
print('*'*(i+1))
Q:13
Solution
for i in range(r,0,-1):
print('*'*i)