AMS 209: HW 4: Problem 1ΒΆ

 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
#!/usr/bin/env python3
# coding: utf8

'''
Created on October 31st, 2017

@author: Geetanjali
'''

def  right_justify(name):
	"""
	:param name: name to be printed
	:return: doesn't return anything. Prints name right-justified
	"""

	length = len(name)
	offset = 70 - length
	space_str = " "
	for i in range(0, offset):
		space_str = space_str+" "
	print(space_str+name)


if __name__ == '__main__':
	name = input("Enter your name:")
	right_justify(name)