Skip to content
MathsGenie logo
Quick links
Open app

Course home

  1. IGCSE
  2. Computer Science Edexcel
  3. Question bank

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]

Input/output Questions

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