This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#To check whether a string is a palindrome or not. | |
s=input('Enter a word') | |
l=len(s) | |
mid=l//2 | |
rev=-1 | |
for a in range(l): | |
if s[a]==s[rev]: | |
rev-=1 | |
else: | |
print("not a palindrome") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import platform | |
import os | |
import sys | |
import urllib.request | |
if 'Windows' in platform.system(): | |
# In case the python version is 3.6 and the system is 32-bit, try pycairo‑1.19.1‑cp37‑cp37m‑win32.whl version of cairo | |
if sys.version[:3]=='3.6' and platform.machine()=='x86': | |
urllib.request.urlretrieve("https://download.lfd.uci.edu/pythonlibs/w3jqiv8s/pycairo-1.19.1-cp36-cp36m-win32.whl", "pycairo-1.19.1-cp36-cp36m-win32.whl") | |
os.system("pip install pycairo-1.19.1-cp36-cp36m-win32.whl") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# By Naveen M K | |
from manim import * | |
from text2svg import TextInfo, register_font, Style, Weight,CharSettings,text2svg | |
import os | |
import hashlib | |
import re | |
TEXT_MOB_SCALE_FACTOR = 0.05 | |
class Text2(SVGMobject): | |
def __init__( | |
self, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from manim import * | |
class Emoji(Scene): | |
def construct(self): | |
a=Text('❌️ 😢 🔚 😀 ✨✨✨',font="sans-serif",color=RED).scale(2) | |
self.play(Write(a)) | |
self.wait() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from manim import * | |
import numpy as np | |
class PIDay(Scene): | |
def construct(self): | |
self.camera.background_color = "#ece6e2" | |
pi=Tex("$\pi$") | |
pi.scale(6.) | |
pi.set_color(BLUE) | |
pi1 = pi.copy() | |
pi1.set_color(RED) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows Registry Editor Version 5.00 | |
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MSYS here] | |
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MINGW64 here] | |
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MINGW32 here] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from manim import * | |
class SmokeTests(Scene): | |
def wait_and_clean(self): | |
self.wait(1) | |
self.clear() | |
def construct(self): | |
tex_test = [ | |
r"\LaTeX", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import typing | |
from pathlib import Path | |
import requests | |
from textwrap import dedent | |
import tempfile | |
import tarfile | |
import logging | |
logger = logging.getLogger("downloader: ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
def is_prime(n): | |
if n < 2: | |
return False | |
if n == 2: | |
return True | |
if n % 2 == 0: | |
return False | |
sqrt_n = int(math.floor(math.sqrt(n))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def no_common_element_list(a,b): | |
return set(a) - set(b) == set(a) and set(b) - set(a) == set(b) |
OlderNewer