Python Programming tutorials
Composed and presented by Nyumwisa Amino
1. Write a program that will calculate the average percentage for 6 modules a
MUST student got on end of semester 1 exams. (indicate name of module when
prompting the user to enter the marks, e.g. “enter marks you got on LCOS”)
Hint: use arithmetic operations to find the average and don’t break the BODMAS
rule, we don’t want logic errors.
2. Write a program that will let a user enter 3 words separately... the words should
be "python", "is" and "great". The program should combine the 3 words to form
a sentence that reads "python is great". After printing that line, the computer
should print another line of the same words but staring from the final word i.e.
“great is python”.
3. Foster (your friend) and Felton are contesting for a position of a first-year
representative. You discover that results from girls have few that are voting for
your friend and more are voting for Felton. the same applies to the votes from
boys. you clearly see that Felton will win after combining the votes from girls
and boys. you are told by your lecturer to create a program used to sum up the
votes and bring forth the total for each candidate. You want to use the program
to make foster win by swapping the results. Hint: you will first require the
lecturer to enter total number of votes from girls who voted for Foster (your
friend) and then enter those from boys who voted for foster too and sum them
up. you will then do the same for Felton and sum them up. you will then assign
the total votes from girls and boys that voted for Felton to foster (your friend)
and assign those for foster to Felton in the final print statement.
Tiyeni nazoni magaye!! All the best!