Animated Rainbow Christmas tree in python in 14 lines of code!!! #shorts #programming #python

preview_player
Показать описание
This is the second part of my first video.
SUBSCRIBE!!! pls
#shorts #programming #python
Рекомендации по теме
Комментарии
Автор

This is one of the things that makes Python great. It can do some really cool stuff with really concise yet generally pretty readable code, and it seems to have a library available for almost anything.

GuyFromJupiter
Автор

Try curses or You can make the cursor move vertically up by using \033[nA where n is the amount of lines you need to go up. This only works if your terminal(or emulator) supports ANSI escape sequences.

Der_Rotsteiner
Автор

Great but the thing that will make it better is after you tehnically calculate all of the colors, dont print each one by one and then calculate the next one, id recommend you calculate the whole thing at once, put it in a string, then print it, then again, calculate, cls, and print, will mame it look a lot better

maxialeksandrov
Автор

" " can be golfed even more, like " " * N and you can from `random import choice as ch` and a lot of other things to reduce the amount of characters further

ahjsbkdjhavkcjhvac
Автор

why clear the console when you can just use \r to stop the weird effect?

yeahhhhhhhhhhhhhhhhhhhhhhhhhh
Автор

Nice I’m learning python and I’m trying to make encryption algorithms that use gpu acceleration

Ðogecoin
Автор

Translate this because i'm too lazy for that
Я попробовал сделать подобное дерево, используя минимальное количество строчек кода. Но я писал код на телефоне, поэтому использовал ANSI-код в чистом виде. Я не очень хороший программист, я даже не окончил школу, но что-то получилось...

import time, random, os
while True:
for i in list(range(1, 23))+[3, 3, 3, 3]:print(' '*(22-i)+' (list(range (91, 97))+list(range(31, 37)))}m#' for v in range (i))))


Я кстати не знал, что можно очистить терминал, увидел такое у тебя в коде)

Данька-ог