0% found this document useful (0 votes)
10 views1 page

Term Paper Python Question New

questions on python

Uploaded by

Biney Emmanuel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views1 page

Term Paper Python Question New

questions on python

Uploaded by

Biney Emmanuel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

University of Cape Coast

College of Education Studies


Faculty of Science and Technology Education
Department of Mathematics and ICT Education

MEd (Information Technology)


EIT 816S Programming Language for Education II
Instruction: Answer all Questions. Submission Date: 22/11/2023

Instruction: Please run the following code in PyCharm and print out the output

1.
a. Using python write program to ask the user to input a character. The program checks
whether the entered character is equal to the lowercase or uppercase vowels, if it is
then the program prints a message saying that the character is a vowel else it prints that
the character is a consonant. (20 marks)
2.
a. Write a code in python with a function add() that adds two numbers passed to it as
parameters. Later after function declaration then you call the function twice in your
program to perform the addition. (10 marks)
b. Using the function above provide the default argument for the second parameter, this
default argument would be used when you do not provide the second parameter while
calling this function. (10 marks)
3.
a. Use python to write a for loop to iterate over a list of numbers from 1 to 20. In the body
of for loop you should be able to calculate the square of each number present in the list
and display the output window. (10 marks)
b. From the example above, you can iterate over a list using for loop. However used a
range() function in for loop to iterate over numbers defined by range(). (10 marks)

You might also like