Modules in Python : random, os, sys and time - Leela Soft Technologies Vijayawada - Madhu Baswani

Опубликовано: 02 Май 2026
на канале: Leela Soft
268
44

#MADHU #LEELASOFT #MODULES #PYTHONMODULES #OS #RANDOM
randint(self, a, b)
Return random integer in range [a, b], including both end points.
randint(0,9)
randint(1,6)

choice(self, seq)
Choose a random element from a non-empty sequence.
random.choice("") #IndexError: Cannot choose from an empty sequence
s = random.choice("abcde123456!@#$%^")

import sys
x = sys.argv

import os
os.system('mspaint')
os.system('cls')
os.system('notepad')
os.system('javac Test.java')
os.system('java Test')

import time
time.ctime()