Python Codes Basic to Advance
2.65K subscribers
82 photos
5 videos
8 files
100 links
Python Codes Basic to Advance

All Codes
@C_Codes_pro
@CPP_Codes_pro
@Java_Codes_Pro
@nodejs_codes_pro

Discussion
@bca_mca_btech
Download Telegram
Alternative of print func in python
import logging
logging.basicConfig(level=logging.INFO)
logging.info('This is an alternative to print using logging module!')

2nd method
import sys
sys.stdout.write("This is 2nd alternative to print using logging module")


Join :- @Python_Codes_Pro

Support group :- @python_group_pro
2👍1
Create array in python
import array
l1=array.array("i",[1,2,4,8])
print(l1)
for i in l1:
print(i)
# convert array into list
to_list=l1.tolist()
print(to_list)
# convert array into byte
print(l1.tobytes())

# find type code of array
print(l1.typecode)

# give buffer info>>>> location and length of array
print(l1.buffer_info())

# find item size

print(l1.itemsize)


for More details Visit : link

Join :- @Python_Codes_Pro

Support group :- @python_group_pro
3
1.Write a Python script to create a list of first N terms of a Fibonacci series.
2. Write a Python script to create a list of first N prime numbers.
don't use any library/module

Join :- @Python_Codes_Pro

Support group :- @python_group_pro
2
Class and Objects in Python
class Person:
std="sixth"

def __init__(self,name):
self.name=name
self.std=std
def showdeatils(self):
return f"My name is {self.name} and I`m Studying in {self.std}"
boy1=Person("Mukesh")
print(boy1.showdeatils())


for More details Visit : Link
1
Guess the Output?

print(not None)
Anonymous Quiz
29%
None
17%
False
23%
True
32%
Error
👍1🔥1
1
program to take input a month and year and print number of days in it.
Sample :-


input - January, 2024
output - days - 31
3👍1🔥1
Guess the Output?

x=5,000.00 ;print(x)
Anonymous Quiz
65%
5,000.00
12%
(5, 0.0)
23%
5000
🔥2
Fade in and out for 2 seconds in video using moviepy

Language: Python
Jᴏɪɴ ᴜs :- @Python_Codes_Pro

Support group :- @python_group_pro
🔥21
Guess the Output?Give reason in comment

print(0.1+0.2==0.3); print(0.1+0.3==0.4)
Anonymous Quiz
61%
True True
17%
True False
12%
False, False
10%
False, True
😁4👍1🔥1
9 Python For Generative AI
Language: Python
Jᴏɪɴ ᴜs :- @Python_Codes_Pro

Support group :- @python_group_pro
👍21
print(0xA + 0xB + 0xC)
Anonymous Quiz
35%
0xA0xB0xC
44%
Error
9%
0x22
12%
33
1💋1
Node js full video
https://youtu.be/WW4NZySuL5Y?si=dDLJBTnufUn7Ub1m

After watching it next:
Create telegram bot
Create websites
Create apis
Create apps
And so on...

Topics Covered:
00:00:00 - Intro of video
00:02:26 - Introduction to node js
00:05:59 - Setup node js environment
00:07:33 - Installing Visual studio Code IDE
00:08:39 - Installing Node js
00:12:58 - Understand about node folder setup
00:15:18 - Basic function of js console.log
00:19:25 - Basic Datatypes of js (Start of basic javascript)
00:25:15 - Variables and Constant in js
00:33:45 - Js Object and List (Array)
00:53:08 - Javascript Operators
01:02:24 - if else Control statement in js
01:08:00 - while and for loops in js
01:17:01 - functions in javascript
01:21:23 - Understand asynchronous javascript
01:26:52 - Understand why async/await in js
01:31:01 - Understand js callback functions
01:36:38 - Use of built in modules in js (example: fs module)
01:40:32 - installing external libraries and fetching data (example axios)
01:48:14 - Anonymous functions in js
01:51:38 - Some of my words for why you learnt this js

Watch it first at morning 8:30 (Live)

Node js full video
https://youtu.be/WW4NZySuL5Y?si=dDLJBTnufUn7Ub1m
👍1
Node js full video watch now live
https://youtu.be/WW4NZySuL5Y?si=dDLJBTnufUn7Ub1m

After watching it next:
Create telegram bot
Create websites
Create apis
Create apps
And so on...
👍1
a = ([])
print(type(a))
Anonymous Quiz
36%
tuple
36%
list
14%
set
14%
NoneType
a = ([])
b = []
print(type(b.append(a)))
Anonymous Quiz
28%
tuple
45%
list
19%
set
9%
NoneType
👍1
Guess The Output?

my_list = [True, False, True, None, True]; print(any(my_list)); print(all(my_list))
Anonymous Quiz
2%
None , None
30%
Error
27%
False , True
30%
True , False
12%
True , True
Forwarded from Cᴏᴅᴇs Sɴɪᴘᴘᴇᴛs (Mᴜᴋᴇsʜ)
Tip : Use the zip() function to iterate over multiple iterables simultaneously

Example:

# Create two lists
names = ["John", "Mary", "Bob"]
ages = [30, 25, 40]

# Iterate over both lists using zip()
for name, age in zip(names, ages):
print(f"{name} is {age} years old.")

Benefits:

* Simplifies the process of iterating over multiple lists or tuples
* Ensures that the elements from corresponding lists are aligned

Language: Python
Jᴏɪɴ ᴜs :- @CodesSnippet
Jᴏɪɴ ᴜs :- @Python_Codes_Pro

Support group :- @python_group_pro
😁1
Forwarded from Cᴏᴅᴇs Sɴɪᴘᴘᴇᴛs (Mᴜᴋᴇsʜ)
print(not print())
Anonymous Quiz
50%
Error
29%
None
21%
True