System Timer Timer
Write a program that gets a numeric as a second (s) from the user and after S seconds pass the system
Write a program that gets a numeric as a second (s) from the user and after S seconds pass the system
import time import os import platform def shutdown_system(seconds): """سیستم را پس از گذشت s ثانیه خاموش میکند.""" print(f"سیستم پس از {seconds} ثانیه خاموش خواهد شد...") time.sleep(seconds) # Looking forward to staying for S second # Operating system review and executing the shutdown command if platform.system() == "Windows": os.system("shutdown /s /t 1") # Turn off in Windows elif platform.system() == "Linux" or platform.system() == "Darwin": os.system("shutdown now") # Off on Linux and Macos else: print("سیستم عامل پشتیبانی نمیشود.") def main(): try: seconds = int(input("لطفاً تعداد ثانیهها را وارد کنید: ")) if seconds < 0: print("لطفاً عددی مثبت وارد کنید.") return shutdown_system(seconds) except ValueError: print("لطفاً یک عدد صحیح وارد کنید.") if __name__ == "__main__": main()
import os x = os.system("shutdown /s /t 10") print(x)
The number of seconds must be received from the user
import platform import time import os def shutdown_system(s): print(f"please wait for shutdown system secend {s}") time.sleep(s) if platform.system() == 'Windows': os.system("shutdown /s /t 1") number = int(input("number_secend: ")) shutdown_system(number)
Submitting answers is currently unavailable.
Online Store with the following features to add new product by Admin in the Management Panel Panel User Name by User Selecting and Registering (Online Payment and Home Payment Option ...
Write a program that receives the radius of the circle and prints its area and environmental area = radius * Pi (3.14) circle environment = diameter (radius * 2) * Pi (3.14)
Write a function that receives a username and if it was a character except the lowercase English letters, FALSE and otherwise TRUE
Write a program that receives a solar date from the input (in the format of yyyy/mm/dd). Then convert the date to AD and print in the output
Parking Management Program Write: When arriving, arrival time and car license plate number stored when exit, exit time save for the desired car at any moment (in the parking lot, exit) and other information ...
CSS Code Write to select the DIV below and change the color of the texts inside to green<div id="mybox">code-bezan.ir</div>
Write a function that receives a list of numbers and generates 2 lists for pair and individual numbers and prints in the output example ([1,2,3,4]) Output: [1,3] [2,4] [2,4]
You must be logged in to access this section.
Login/Sign up If you don’t understand the exercise or can’t solve it for any reason, that’s completely
normal—don’t worry 😊
Try checking out easier exercises and reviewing different answers
submitted by others. Gradually, you can move on to more challenging exercises. Also, your answer
might be correct even if it’s different from others.