To keep a desktop computer or a server powered up when the electricity goes off in addition to protection against power fluctuations, an <u>uninterruptible power supply (UPS)</u>, which contains a built-in battery, can be used.
<u>Explanation</u>:
An uninterruptible power supply (UPS) is a device that allows a computer or server powered up for a short time, when the electricity goes off. UPS device also provides uninterrupted service during power fluctuation.
A battery is inbuilt in the UPS and provides power for few minutes to the computer to shut down it in a proper manner.
UPS is available at affordable cost and can be maintained at low cost compared to generators.
In Python, a string is an array of characters, we can access these characters using index operator []. For example, we have a_string = "Hello World" a_string[0] prints the first character in string ('H').
We can also use index operator to make substrings, for example a_string[0:3] will make a substring with first, second, third and fourth character equal to "Hell".
Now to business
my_string = "This is MY string!"
print(my_string[0:7]) # Prints "This is "
print(my_string[0:7:5]) # Prints "T" then prints the sixth character since we start counting at 0 hence prints "Ti" (note that space is also a character).
Hope this helps.
I've included my code in the picture below. Best of luck.
Mainly .com
educational institutes .edu