0% found this document useful (0 votes)
7 views

Python (AutoRecovered)

The document discusses coding concepts like lists, loops, functions, and recursion. It covers topics such as using lists to store data, adding and removing items from lists, conditional statements, defining functions, passing arguments to functions, returning multiple values from functions, and recursion concepts like the Fibonacci sequence.

Uploaded by

Kunal ahuja
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Python (AutoRecovered)

The document discusses coding concepts like lists, loops, functions, and recursion. It covers topics such as using lists to store data, adding and removing items from lists, conditional statements, defining functions, passing arguments to functions, returning multiple values from functions, and recursion concepts like the Fibonacci sequence.

Uploaded by

Kunal ahuja
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Coding

List – bohot saara data hai jisko ek saath sore karana hai to usko list kahenge – collection banana ke
liye suare brackets lagte hai

Fruits = [‘apple”, “banana”, “papaya”]

Fruits.append(yellow) – isse ek item add ho jayegi

Fruits.pop(yellow) – isse yellow remove ho jayega

Fruits[0:1] = [1,2]

speed=80
if speed > 60:
print("500 ka chalan")
else:
print("you are safe")

LOOPS:
Class 3

Function ke liye def likhdo

Fir function ka naam

Fir variables

Function ke andar jo bhi input daalna hai jo bhi usko argument kehte hai

MULTIPLE RETURN VALUES PEBANA FUNCTION :


def f(a):
return 2*a, 3*a, 4*a

x,b,c = f(20)
print(x,b,c)

SEPCIAL FUNCTION – MAIN FUNCTION

__name__=='__main__=

ek function mein ek variable ka scope us function ke end tak hi rehta hai

agar aisa nahi chaiye then write global a, fir wo variable global ho jayega
MATRIX INPUT POORA POOCHNA

Class 4

Hashing : wo har value ko ek unique hash de deta hai aur ek stream of data mein kuch check karna
hoga ki kuch exist karega yan ahi to hashing se bohot easily ho sakta hai and bohot jaldi bhi

Askii value pata karne ke liye ord function use karoo

Mutable cheeze vo hoti hai jo apni value change kar sakti hai – only immutable things can be hashed

Recursion:

Fibonachi ?????
Sorted

key function

You might also like