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.
Write a function that receives a string and returns the number of letters: To solve this question, you should not use ready-made functions for example: get_len ('code-bezan.ir') # 13
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 2 numbers from the input and prints the larger number
Write a function that receives a word and changes each letter to its next letter in the alphabet. Then returned the result. Indeed: "A" turns into "B" "" B "becomes" C "" C "becomes" D "and ........
Write a function that receives the bank card number as an entrance and places * for all its digits except the first and last digits and give some example as the example below: ("603711121119900") "60 ... 60 ...
Write a program that receives a one -digit number from the input and finds the coefficient of smaller than 100 of those numbers and prints in the output
Write a program that receives a sentence and reversed each of the words and re -print the sentence without changing in the order of words. Input: Hello Amir ... Olleh Rima ...
Create a list and display the following on the screen. Next to each item must be automatically placed.
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام 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.