# #Random module example # import random # list=[1,3,5,7,9,11] # choice=random.choice(list) # print(choice) # #Image module example . Use ' when covering not " . Always use from Pil import image,BEC It is syntax # from PIL import Image # im = Image.open('C:\\Users\\alex9\\OneDrive\\Pictures\\images.jpg') # im.show() #time # import time # inpot=input() # if inpot=="what is time": # times=time.asctime() # print(times) # else: # print("You entered wrong word")
############ Functions and Docstrings Tutorial ################# # Function helps in code reuseability ########################################## ## Example of built in function a = 9 b = 8 # Sum is a inbuilt function in Python # takes tuple or list (more, general Iterables) as input c = sum (( a , b )) print ( c ) # Output : 17 ########################################## ## Example of user defined function ## The keyword def introduces a function definition. # It must be followed by the function name and # the parenthesized list of formal parameters. # The statements that form the body of the function # start at the next line, and must be indented. def function1 (): print ( "Hello you are in function 1" ) function1 () # Output : Hello you are in function 1 ##### Functions with Parameter & Return Statement #### # The 'return' statement returns with a value from a function. # 'return' without an expression argument returns None # if no ...
Comments
Post a Comment
Comment if you need help .I will not replay sometimes