ar
Feedback
Python Codes Basic to Advance

Python Codes Basic to Advance

الذهاب إلى القناة على Telegram
2 813
المشتركون
لا توجد بيانات24 ساعات
-47 أيام
-2430 أيام
أرشيف المشاركات
Task: You have to create a program where a list of numbers is given and a number of rotation is given. Now you to bring last number of list in front and swift each number to the right. Do this till the given number of rotation. Sample :- input - [1,2,3,4] , 2 output - [4,1,2,3] -> [3,4,1,2] Good luck!

X=['h', 'i'] Y=sorted(['i','h']) print(X==Y)
Anonymous voting

X=['h', 'i'] Y=['i','h'] print(X==Y)
Anonymous voting

Check either string is an Anagram or not?
An anagram is a word or phrase that is created by rearranging the letters of another word or phrase.
def is_anagram(str1,str2):

    return sorted(str1)==sorted(str2)

print(is_anagram("astronomer","moonstarer"))
#Output : True

Guess the Output???
def foo(a,b=10,c=17):

    return a+b+c

print(foo(a=1,b=8))

Convert Timestamp to Indian Time Zone Using Python.

import datetime
import pytz

def convert_timestamp_to_ist(timestamp: int) -> str:
    utc_date_time = datetime.datetime.utcfromtimestamp(timestamp)
    
    utc_time_zone = pytz.timezone('UTC')
    utc_aware_datetime = utc_time_zone.localize(utc_date_time)
    
    ist_time_zone = pytz.timezone('Asia/Kolkata')
    ist_aware_datetime = utc_aware_datetime.astimezone(ist_time_zone)
    
    formatted_date = ist_aware_datetime.strftime('%A, %Y-%m-%d %H:%M:%S')
    
    return formatted_date

# print(convert_timestamp_to_ist(1717000920))
Output:
  Wednesday, 2024-05-29 22:12:00

Comment your answer
Comment your answer

Comment your answer
Comment your answer

Which of the following operators has the lowest precedence?
Anonymous voting

y, z = 10, 15 y *= y + z # What is the value of y. Explain How?
Anonymous voting

Convert Animated Gif to video
from os import remove,popen
import subprocess

def sprocess(a, b="utf-8"):
    p = subprocess.Popen(a,shell=True,stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
    return str(p[0].decode(b)+p[1].decode(b))

vid = await message.reply_to_message.download()

print(sprocess("ffmpeg -y -i '" + vid + "' -map_metadata -1 s.mp4"))

durasi = popen("ffprobe -i '" + vid + "' -show_entries format=duration -v quiet -of csv='p=0'").read()

await message.reply_video(video="s.mp4")

remove("s.mp4")
remove(vid)
Sample response https://t.me/the_support_chat/146439

Roadmap: • Frontend : https://roadmap.sh/frontend • Backend : https://roadmap.sh/backend • Devops : https://roadmap.sh/devops • Reactjs : https://roadmap.sh/react • Android : https://roadmap.sh/android • Angular : https://roadmap.sh/angular • Python : https://roadmap.sh/python • Golang : https://roadmap.sh/golang • Java : https://roadmap.sh/java #Roadmap Jᴏɪɴ ᴜs :- @Python_Codes_Pro Support group :- @python_group_pro

Convert Image to text
import pytesseract as t
from PIL import Image

img = Image.open("photo.jpg")
text = t.image_to_string(img)

print(text)
Language: Python Jᴏɪɴ ᴜs :- @Python_Codes_Pro Support group :- @python_group_pro

Rotate character using python.
import time
rotation_chars = ['-', '\\', '|', '/']
while True:
        for char in rotation_chars:
            print(char, end='\r')
            time.sleep(0.5)
Language: Python Jᴏɪɴ ᴜs :- @CodesSnippet

Jᴏɪɴ ᴜs :- @Python_Codes_Pro Support group :- @python_group_pro
Jᴏɪɴ ᴜs :- @Python_Codes_Pro Support group :- @python_group_pro

Python Oops challenge What is the output of following Python Code?
Python Oops challenge What is the output of following Python Code?

Kaun jeetega?
Anonymous voting

Top 5 Coding Challenge Platforms for Programmers 👩‍💻🚀 1. LeetCode    - URL: https://leetcode.com    - Description: Enhance problem-solving skills with a vast collection of coding challenges on LeetCode. 2. HackerRank    - URL: https://www.hackerrank.com    - Description: HackerRank offers diverse coding challenges for algorithm, data structure, and language proficiency improvement. 3. CodeSignal    - URL: https://codesignal.com    - Description: CodeSignal provides coding challenges and assessments to enhance coding skills for interviews and practice. 4. Codewars    - URL: https://www.codewars.com    - Description: Codewars engages developers in creative problem-solving through kata challenges, fostering skill development. 5. Exercism    - URL: https://exercism.io    - Description: Exercism offers coding exercises in various languages, providing mentorship and community support. All the best 👍👍 Jᴏɪɴ ᴜs :- @CodesSnippet

Repost from PYTHON PROGRAMMING
Python, Java , C Developed by:
Anonymous voting

In Which Python library is used in Data Science 🤔
Anonymous voting