Ask coding questions

← Back to all posts
i need help making jarvis
theopythontest (0)

so far all he can do is tell you the time

Answered by JonDoeBeep (42) [earned 5 cycles]
View Answer
JonDoeBeep (42)

What do you need help doing with jarvis?

theopythontest (0)

@JonDoeBeep i need a login system that also has it so if you want the time and input the cmd time then you have to be logged in otherwise it doesnt work

JonDoeBeep (42)

@theopythontest Maybe put the time inside of a function and then make it run on login (I'm not great at explaining so i will post an example.)

from time import time, ctime
def otime():
  t = time()
def logon():
  print("enter username and password")
  u1 = int(input("Username: "))
  p1 = int(input("Password: "))
  if (p1 == passw and u1 == user):
     print("Logged on!")
     print("Try again!")
theopythontest (0)

@JonDoeBeep the login works but

enter username and password
Username: f
Password: h
Logged on!
Traceback (most recent call last):
File "", line 17, in <module>
File "", line 13, in logon
NameError: name 'otime' is not defined

JonDoeBeep (42)

@theopythontest make the first function name be otime
also updated the code so if you want to copy that it should work

theopythontest (0)

@JonDoeBeep it works perfectly thx.if u want u can have the code i am using so then if u ever want to make an ai u are already started