Skip to content

Course home

Programming concepts

Programming concepts

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
Question 34

Write a Python program to authenticate a user trying to log into a secure school lab terminal.

The program should:

  • Prompt the user to enter their username
  • Prompt the user to enter their password
  • Display the message Access denied if the entered username and password combination is not valid
  • Display the message Access granted if the entered username and password combination is valid
  • Repeat this process until a valid username and password combination is entered.

You should use indentation as appropriate, meaningful variable name(s), and correct Python syntax in your answer.

Figure 1: Valid Login Credentials

UsernamePassword
Teacher1Lab99*
StudentAXy3_7
[7]
Markscheme

Programming concepts Questions

  1. GCSE
  2. /Computer Science
  3. /Programming concepts

298 exam-style questions on AQA GCSE Computer Science Programming concepts. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank