Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

You must login to ask a question.

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Quizzma Latest Articles

4.4.4 Administrators, Teachers, Students CodeHS Answers

The most common answer is:

Type =input(“Are you an administrator, teacher, or student?: “)
if(Type==”Administrators”)or(Type==”teacher”):
print(“Administrators and teachers get keys! “)
elif(Type==”student”):
print(“Students do not get keys!”)
else:
print(“You can only be an administrator, teacher, or student!”)

To ensure this program runs correctly and adheres to Python syntax, including using standard ASCII quotation marks and adding proper case handling for the input, here’s the revised version:

user_type = input("Are you an administrator, teacher, or student?: ").lower()

if user_type == "administrator" or user_type == "teacher":
    print("Administrators and teachers get keys!")
elif user_type == "student":
    print("Students do not get keys!")
else:
    print("You can only be an administrator, teacher, or student!")

This code will:

  • Prompt the user to specify if they are an administrator, teacher, or student, and convert their response to lowercase to ensure the comparison is case-insensitive.
  • Check if the user’s role matches “administrator” or “teacher” and print that they get keys.
  • If the user is a “student”, it prints that students do not get keys.
  • If the input does not match any of the roles, it informs the user they can only be an administrator, teacher, or student.

Was this helpful?




Quizzma Team

Quizzma Team

The Quizzma Team is a collective of experienced educators, subject matter experts, and content developers dedicated to providing accurate and high-quality educational resources. With a diverse range of expertise across various subjects, the team collaboratively reviews, creates, and publishes content to aid in learning and self-assessment.
Each piece of content undergoes a rigorous review process to ensure accuracy, relevance, and clarity. The Quizzma Team is committed to fostering a conducive learning environment for individuals and continually strives to provide reliable and valuable educational resources on a wide array of topics. Through collaborative effort and a shared passion for education, the Quizzma Team aims to contribute positively to the broader learning community.

Related Posts

Leave a comment