You've got a number of options:
Taking your original code you could simply tab the next item along:
for key, value in Student_Name.items():
print(key,'',value)
Although this wouldn't be perfect as it's a tab, and unless all the keys are similar length it wouldn't look as you intended.
Output:
Mathematics 90
Computer Science 100
Chemistry 90
Physics 97
English 95
A better solution could would be:
for key, value in Student_Name.items():
print(f'{key:20}{value}')
output:
Mathematics 90
Computer Science 100
Chemistry 90
Physics 97
English 95
Python 3.6 required
My only question to you is why, you want to do this and would it be better to print some file and use delimiter and worry about presentation later. Either way you should be able to do with the above
Equally suitable would be the 1st answer here
for key,value in Student_Name.items():
... print("{0:20}{1:5d}".format(key,value))
Which out puts the same as f' but, both have the problem that if the subject key
is much longer than the others the appearance will need to be amended. Changing key {key:20}
or {0:20}
to a greater number will help, but maybe you could count check the length of your keys using the longest as the value here plus 5 for padding.
for example you could do this (added in an extra key for illustration purposes:
Student_Name = {"Mathematics": 90, "Computer Science": 100, "Chemistry": 90, "Physics": 97, "English": 95, "REALLY LONG SUBJECT ABOUT POLITICS": 10}
# Get the longest subject name
length = max(len(x) for x in Student_Name)
# decide on padding
padding = 5
#use these two value to working out the exact space required
space = length + padding
#format and print the statement
for key, value in Student_Name.items():
... subject = "{0:{space}}".format(key, space=space)
... result = "{0:5d}".format(value)
... print(subject + result)
Output :
Mathematics 90
Computer Science 100
Chemistry 90
Physics 97
English 95
REALLY LONG SUBJECT ABOUT POLITICS 10
Would always make the result the right distance away from the longest subject name.