import sys
import time
import os
print("Hello My guy, welcome to the World of Programs!")
def clearConsole(): lambda: os.system('cls' if os.name in ('nt', 'dos') else 'clear')
def WP():
new_old = input("Are you new to this world or u are new? ").lower()
if new_old == "no" or new_old == "old":
print("Welcome to this world my old friend, How are you doing?")
elif new_old == "yes" or new_old == "new":
print("Register: ")
time.sleep(1.5)
# asks user to enter their username
userName = input("Pls enter your user name: ")
# asks user to enter their password
passWord = int(input("""Pls enter your password(numbers only): """))
file = open("us_ps.txt")
file.write("User name = " + userName + "\n" + "Password = " + passWord + "\n" + "Car color = ")
file.close()
clearConsole()
if userName != "" and passWord != "":
print("Lets check if you remember your password!)")
un_check = input("Enter your user name here: ")
ps_check = int(input("Enter your password here(numbers only): "))
if un_check == userName and ps_check == passWord:
print("Welcome to the World of Programs newbie, here you will learn about programs! :)")
sys.exit()
WP()
Error:
file.write("User name = " + userName + "\n" + "Password = " + passWord + "\n" + "Car color = ")
TypeError: can only concatenate str (not "int") to str