Skip to content

Commit 67f2d15

Browse files
committed
.
1 parent c30f194 commit 67f2d15

1 file changed

Lines changed: 146 additions & 6 deletions

File tree

‎payilagam.py‎

Lines changed: 146 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#Learn Python in Most Simplest way & Quick Way
2+
13
# print("hi")
24
# print('hi')
35

@@ -343,11 +345,149 @@
343345

344346
#COMPLEX
345347

346-
print(complex(10))
347-
print(complex(5.4))
348-
print(complex(True)) #True part
349-
print(complex(False)) #imaginary
350-
print(complex("12"))
351-
print(complex("12.7"))
348+
# print(complex(10))
349+
# print(complex(5.4))
350+
# print(complex(True)) #True part
351+
# print(complex(False)) #imaginary
352+
# print(complex("12"))
353+
# print(complex("12.7"))
354+
# print(complex(10,20))
355+
# print(complex(True,False))
356+
357+
#bool True False
358+
# print(bool(0))
359+
# print(bool(1))
360+
# print(bool(1.5)) #Complete Zero False
361+
# print(bool(0.3))
362+
# print(bool(0.0))
363+
# print(bool(5+4j))
364+
# print(bool(0+2j))
365+
# print(bool(0+0j))
366+
# print(bool("True"))
367+
# print(bool("False")) #String always True
368+
# print(bool("")) #Empty string with no sapce False
369+
# print(bool(" ")) #Space False
370+
371+
#STR
372+
# print(str(10))
373+
# # print("Price is "+10)
374+
# print(str("Price is "+str(10)))
375+
# print(str("Price is "+"10"))
376+
377+
# a= str(34.5)
378+
# print(type(a))
379+
380+
# print(str("True"))
381+
# print(str("False"))
382+
383+
#14 DATA TYPES- 5 FUNDAMENTAL DATA TYPES
384+
385+
#ALL Fundamental Data TypeS ARE IMMUTABLE
386+
#integers, floats, booleans and strings. -fundamental data Type
387+
388+
#immutable -not changabale
389+
390+
391+
# immutable example
392+
# no =10
393+
394+
# no2 =10 #it will show the same address
395+
396+
# print(id(no))
397+
# print(id(no2))
398+
# no2=20
399+
400+
# print(id(no2))
401+
402+
# once we change the value of identifier belonging to fundamental
403+
# datatypes it wont get changed.. a new address will be created
404+
405+
#IS will check whterh the both identifier has same address
406+
407+
# no1 =10
408+
# no2 =10
409+
410+
# print(no1 is no2)
411+
412+
# no1 =10
413+
# print(id(no1))
414+
# no2 =10.0
415+
# print(id(no2))
416+
417+
# print(no1 == no2) #Equality operator
418+
# print(no1 is no2) #Identity Operator
419+
# print(no1 is not no2)
420+
421+
#BYTES
422+
423+
# values = [90,80,30,40,400] #Bytes value should be below 256
424+
# values = [10,20,30,40]
425+
# print(values)
426+
# values[0]=20 #List is mutable but once converted to byte cannot mutable
427+
# print(values)
428+
# values = bytes(values)
429+
# print(values)
430+
# print(type(values)) #bytes value cannot be seen
431+
# #to view value use index
432+
# print(values[0])
433+
# print(values[1])
434+
# print(values[2])
435+
# print(values[3])
436+
437+
# print(values[-1])
438+
# print(values[-2])
439+
440+
441+
# to view all values we use loops:
442+
443+
# for x in values:
444+
# print(x)
445+
446+
#wecannot change the value
447+
448+
# values[0]=92 #we will get error
449+
450+
#how to get total value in the list?
451+
452+
# values = [10,20,30,40]
453+
# print(values)
454+
455+
# total = 0
456+
# for x in values:
457+
# print(x)
458+
# total = total +x
459+
# print("total + x = ",total)
460+
461+
# print(total)
462+
463+
464+
465+
#ODD Even
466+
467+
# No = int(input("Enter the Value ")) #change input to int or it will be string
468+
# print(No)
469+
# print(type(No))
470+
471+
# print(int(No)+5)
472+
473+
# No = int(input("Enter the Value "))
474+
# if No%2==0:
475+
# print("Even Number ")
476+
# else:
477+
# print("Odd No ")
478+
479+
480+
values = [10,20,30,40,15]
481+
482+
for x in values:
483+
if x%2==0:
352484

485+
print("Even Number ")
486+
else:
487+
print("Odd No ")
353488

489+
# No = int(input("Enter the Value "))
490+
# if No%2==0:
491+
# print("Even Number ")
492+
# else:
493+
# print("Odd No ")

0 commit comments

Comments
 (0)