0% found this document useful (0 votes)
4 views5 pages

Python Programming Tasks and Examples

The document outlines a Python programming recap with tasks for users to answer questions and create programs based on provided examples. It includes tasks related to user input, variable usage, selection statements, and basic calculations. Each task requires users to write code that interacts with user input and displays results based on specific criteria.

Uploaded by

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

Python Programming Tasks and Examples

The document outlines a Python programming recap with tasks for users to answer questions and create programs based on provided examples. It includes tasks related to user input, variable usage, selection statements, and basic calculations. Each task requires users to write code that interacts with user input and displays results based on specific criteria.

Uploaded by

omariosibo
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Hello

Python Recap
Task 1: answer the following questions in the space provided.
1. What does the input command allow the user to do?

2. Can variables be used again?

Type an answer

3. What is the purpose of selection?

Task 2: create programs using the example below and paste your code into the
space provided.
firstName = input(“Enter your first name”)
print (firstName)

4. Create a program where the user is asked for their Date of Birth, the user enters it
and it is then displayed.

5. Create a program where the user is asked for their Favourite Sport, the user enters it
and it is then displayed.

Classification: General Internal


Purpose
Hello

Task 3: create programs using the example below and paste your code into the
space provided.
firstName = input(“Enter your first name”)
Surname = input(firstName + “ enter your surname”)
print (“Your full name is ” + firstName + “ ” + Surname)

6. Create a program where the user is asked for their Favourite Subject, the user enters
it and it is then displayed as:

Example: Your favourite subject is Computing

7. Create a program where the user is asked for their Name and Hometown, the user
enters it and it is then displayed as:

Example: Amelia is from Ilford

Task 4: create programs using the example below and paste your code into the
space provided.
number1 = int(input(“Enter your first number”))
number2 = int(input(“enter your second number”))

Classification: General Internal


Purpose
Hello

answer = number1 + number2


print (“The answer is ”, answer)

8. Create a program where the total journey cost is calculated by multiplying the
number of miles with £5.

The user enters the data, the program works out the result and it is displayed as:

Example: Your total journey cost is £40

9. Create a program where the average score of 3 exams is automatically calculated


once scores have been entered.

The user enters the data, the program works out the result and it is displayed as:

Example: The average score is 80

Task 5: create programs using the example below and paste your code into the
space provided.
mark = int(input(“enter mark”))

Classification: General Internal


Purpose
Hello

if mark >= 50:


grade = “pass”
print (grade)
else:
grade = “fail”
print (grade)

10. Create a program that asks the user for their age.

If they are 18 or over, it will say please access granted, otherwise it will say access
denied.

Task 6: create programs using the example below and paste your code into the
space provided.
mark = int(input(“enter mark”))

Classification: General Internal


Purpose
Hello

if mark >= 75:


grade = “distinction”
print (grade)
elif mark >= 50:
grade = “pass”
print (grade)
else:
grade = “fail”
print (grade)

11. Create a program that asks the user to enter a month to see if there are any concerts
during that month.

If they enter August, it will say 2 concerts, if they enter November, it will say 1
concert, otherwise it will say no concerts

Classification: General Internal


Purpose

You might also like