Skip to content
Sign upLog in
← Back to Community

problem

Profile icon
Narut0Uzamaki

I can`t figer out how to let people enter text

Voters
Profile icon
thepurpleguy33
Profile icon
Narut0Uzamaki
Comments
hotnewtop
Profile icon
JBloves27

Well, you want an input() to make the person input something. So for your example, you want it to show precise time, so you have to use the datetime module. It has the precise time of most cities and countries. So do the following:

from datetime import datetime ... exact_time=datetime.now() ... the_time=now.strftime("%H:%M:%S") print("The current time is ", the_time)

I hope this helps!

Profile icon
Narut0Uzamaki

@JBYT27
thanks very much

Profile icon
JBloves27

np! glad i helped!

@Narut0Uzamaki

Profile icon
RYANTADIPARTHI

Solution

here's how you can get the current time. You could use the datetime module in python.

from datetime import datetime now = datetime.now() current_time = now.strftime("%H:%M:%S") print("Current Time =", current_time)

like that.
That should work

Profile icon
bottlesandcaps

where do u want the text to be entered at

Profile icon
Narut0Uzamaki

@bottlesandcaps
i am trying to creat a inter active bot with will give you the time

Profile icon
bottlesandcaps

@Narut0Uzamaki
time of what

Profile icon
Narut0Uzamaki

@bottlesandcaps
the day at that precice moment eg "what is the time " "IT IS 13:32

Profile icon
Bookie0

@Narut0Uzamaki
for the time, check my tutorial out here

My tutorial will explain how to use input to get the user to enter a city in a country, and the program (or your bot) will return the time.