Skip to content

Course home

Input/output

Input/output

EasyMedium
1234
Question 4

Liam has written a program to calculate electricity bills.

1  base_rate = 0.15
2  username = input("Enter your name: ")
3  units_used = int(input("Enter units consumed: "))
4  total_cost = base_rate * units_used
5  print("User " + username + " owes " + str(total_cost))

Identify the line number where a variable is assigned a numeric value entered by the user.

[1]
Markscheme

Input/output Questions

  1. IGCSE
  2. /Computer Science
  3. /Input/output

5 exam-style questions on Edexcel IGCSE Computer Science Input/output. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank