+ 1

How to print a certain text in the screen after a particular time using python?

Suppose you're making a car game (without GUI) You type 'strt' to start and 'stp' to stop When you type 'strt', the car runs. Initially it's speed is 30 km/hr. In the screen, it shows "SPEED : 30 KM / HR" After 3 seconds, a new text gets printed on the screen, which says, "SPEED : 50 KM / HR" Also, i want this speed to keep changing time by time How to create such a code?

5th Apr 2021, 3:00 PM
PHILOMATH PRATIK
PHILOMATH PRATIK - avatar
2 odpowiedzi
+ 2
import time speed=0 print(speed) while True: speed+=1 print(speed) time.sleep(1) #in seconds The above Program increase speed by 1 in every seconds.
5th Apr 2021, 3:17 PM
Vadivelan
0
Vadivelan thank you ❤️
7th Apr 2021, 1:46 PM
PHILOMATH PRATIK
PHILOMATH PRATIK - avatar