Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
Write a function for checking the speed of drivers.
Write a function for checking the speed of drivers. This function should have one parameter: speed. Ā If speed is less than 70, it should print āOkā. Ā Otherwise, for every 5km above the speed limit (70), it should give the driver one demerit point and print the total number of demerit points. For example, if the speed is 80, it should print: āPoints: 2ā. Ā If the driver gets more than 12 points, the function should print: āLicense suspendedā
3 Respostas
0
I am still thinking but its jst dosnt seem to crack šŖ
can think of only the long way
but it will be too many if n else statement
0
Before we can help you, please do a try by yourself, put it in playground and post it here. Thanks!
0
if(speed<70)print(āOkā)
else
{
print("Points:"+((speed-70)/5));
if((speed-70)/5)>12)
print(āLicense suspendedā);
}