Restart Windows 10 Using Python

A Python script to restart a computer

Restart Windows 10 Using Python

import os
restart=input("Do you wish to restart your computer?(y/n):")
if restart =='no':
 exit()
else:
 os.system("shutdown/r/t1")

This is a Python Program which will ask the user to restart the computer providing the option y or n.

When the user type y the system will restart instantly