#python function
Explore tagged Tumblr posts
Text
#python function#python tutorial for beginners#python tutorial#python#python libraries#python lambda#python boots
0 notes
Text










These are the vibes I THE WHYTE PYTHON WORLD TOUR brings to the function bookshelf.
It's Spinal Tap meets Austin Powers.
It's an 80s themed wrestling duo alarming the interviewer.
It's Lorelei Gilmore Reading THE DIRT.
It's Ozzy Osbourne on reality TV.
It's "The Wind of Change" being used as a political battle cry.
Get ready for the world tour...
#fiction#books#whyte python world tour#reading#spinal tap#austin powers#the vibe i bring to the function#carl hiaasen#satire#humor#comedy#book review
340 notes
·
View notes
Text
deskpet mikey :)

#if anyone wants him i can put him on a github repo with instructions on how to configure him to ur screensize / the right file path#also u need to have python and pyautogui installed and also he only works properly on windows. i need to fix the little white dots#i love my barely functional son 🫶#my art :D#woe.begone
60 notes
·
View notes
Text
Feeling inspired by a post I saw a few months ago, I programmed a simple game of tic-tac-toe in python, in a single expression. Like regular functional programming, this means I can't mutate variables. But more than functional programming, this also means I can't
Declare variables at all
Declare functions
Use most loops and branch structures
The resulting program is 1730 characters long after removing all the non-strictly necessary whitespace and contains "lambda" 9 times.
The players are asked where they want to play using a number for each cell, in the configuration of a standard numpad. The program checks for invalid input too.
Source code under the cut
(lambda grid,toggle,players,cells_filled,print_grid,check_victory,ask_xy,validate_input,the_game:(lambda victor:print('=====\n'+('Draw.'if victor is None else f"{victor} wins!")))(the_game(grid,players,cells_filled,toggle,print_grid,check_victory,ask_xy,validate_input,the_game)))([[7,8,9],[4,5,6],[1,2,3]],True,['X','O'],0,lambda grid:print('\n'+'\n'.join(' '.join(map(str,ligne))for ligne in grid)),lambda grid,players:([player for player in players if any(set(grid[i][col]for i in[0,1,2])=={player}for col in[0,1,2])or any(set(grid[row])=={player}for row in[0,1,2])or set(grid[i][i]for i in[0,1,2])=={player}or set(grid[i][2-i]for i in[0,1,2])=={player}]+[None])[0],lambda players,toggle,grid,ask_xy,validate_input:validate_input(input(f"{players[toggle]}, place your symbol: "),grid,players,toggle,ask_xy,validate_input),lambda selection,grid,players,toggle,ask_xy,validate_input:(lambda selection,grid,players,toggle,ask_xy,validate_input:(selection%3,2-selection//3)if grid[2-selection//3][selection%3]not in players else ask_xy(players,toggle,grid,ask_xy,validate_input))(int(selection)-1,grid,players,toggle,ask_xy,validate_input)if len(selection)==1 and'0'<selection<='9'else ask_xy(players,toggle,grid,ask_xy,validate_input),lambda grid,players,cells_filled,toggle,print_grid,check_victory,ask_xy,validate_input,the_game:(print_grid(grid),the_game((lambda players,toggle,xy,grid:[[players[not toggle]if(j,i)==xy else grid[i][j]for j in[0,1,2]]for i in[0,1,2]])(players,toggle,ask_xy(players,not toggle,grid,ask_xy,validate_input),grid),players,cells_filled+1,not toggle,print_grid,check_victory,ask_xy,validate_input,the_game)if check_victory(grid,players)is None and cells_filled<9 else check_victory(grid,players))[1])
If you can't read any of this, don't worry, I can't either.
You can find the original code and a slightly more readable version on my gitlab: https://gitlab.com/Rijaja/gaae/-/tree/main/tttaae (but careful, the game is in French)
96 notes
·
View notes
Text
I'm gonna start working on my sims 4 radqueer script mod again
#we'll see how far my lack of coding skills goes#there's an app that makes it easy#unfortunately it can't be as complex as I want it to be unless I gain the executive function to learn python :(#edit is I Forgor about this but I don't have time anymore#one day...
15 notes
·
View notes
Text
I am writing in python rather than the pre 89 C shitshow at work right now..
And... I am just enjoying mixing function and object oriented design. Procedural mixed with imperative.
Just... making complex machines by swimming through the wonderfull sea of code in a modern langauge
9 notes
·
View notes
Text
i've spent 1.5 years studying and achieving a level of C/C++ literacy to go to a class, which is really cool, basis of machine learning and genetic based algorithms and i am a sucker for biology but we're applying those in python. what sucks is that now my brain and hands literally itch to put semicolons and curly brackets and indent the code to my needs and implement methods and functions when python doesn't even use those :( and now i can do more powerful things but the code looks like we've just discovered how to paint caves with our fingers
#personal ramblings you can totally skip#but it's bugging me a lot#and i know python is a great way as an outsider to get into coding and do some really cool stuff because it has a lot of built in libraries#and the syntax is closer to english than most coding languages#but it's a bit frustrating to me and i lose time trying to rephrase what i've learned so far#the only advantage so far is that instead of writing like 3 different functions for a vector in c/c++#i only use like 3 lines of code in python for the same things#my frustrations could also be from the fact that i went to this class where we used python straight from a 3 hour class where we used c
4 notes
·
View notes
Text
python baby PLEEEEAAAAASEEEEE add generics. it would make my typehinting life SOOOOOO much easier
#programming#python#still haven't found a type checker that doesn't flag my code as “possibly incorrect” because pandas and numpy and stuff love to have like#seventeen different possible return types for a given function#and I don't want them doing static analysis on the whole library because that's why pylyzer has stack overflows out the ass
5 notes
·
View notes
Text
speaking as a previous learner of C, THIS IS THE ONE MOST BEAUTIFUL THING I'VE EVER SEEN

#you can!! chain functions!! on a string!! and it works!! it doesn't throw a tantrum!! it's ok with it!! it loves you!!#python is my beautiful sister and i am playing around with all of her functions in an open field#🌙rambling#no id#🌙computerposting#//edit: YOU CAN JUST DO IT ALL ON THE SAME LINE YOU FIRST GET THE VARIABLE!!!?!#is it ok if i die on your carpet
7 notes
·
View notes
Text
I have a new idea for the wip list that will likely actually get made at some point, but I need to learn programming in Python first smh my head
#i'm fairly decent at web dev coding already and i've heard python is pretty easy to learn#which i hope so because i tried programming basic site functions with JS and it made me want to eat my keyboard#anyways i'm not touching this for a little while. i just wanted to speak it into the world so i dont forget (permanently lol)#elkk.txt
5 notes
·
View notes
Text
This morning I misread the theorem on the board and thought it said subset instead of subspace, which was rather troubling since we used convexity in the argument. Naturally, I ask what guarantees convexity and the professor pointed out subspace so cool. Great.
But he also said "where did you pick that up? Off the street?"
Because yeah, you can use a convex set instead of subspace. But it was such an unexpected question, phrased in such an unexpected way.
#the theorem is the metric based on the min distance between a point and a closed subspace#i do remember proving the closed convex set version once on a hw assignment (differential topology class) and it was a nightmare#seven stories#functional#DEs was also confusing and all over the place today#we were doing some matlab stuff but mostly listend/watched him? but most of us had our laptops out#which was great for me cause i was running a python script all day so I was able to fix a mistake on the input txt file during class#and start the script again#i also just like. did the entire cosing problem from the hw during class. it took like 5 min
4 notes
·
View notes
Text
it may surprise you to know that i AM in fact attempting to start my homework but i got carried away trying to read an article about wave function collapse algorithms
2 notes
·
View notes
Note
hey...... slime.exe.................. the function print("reply") would print the word reply. because putting it in quotes makes it a string. thumbs up
-a python nerd
>>> print ("reply")
oh hello! i see i see thank you for the info!! (人 •͈ᴗ•͈)
#OOC: OKAY DHDJDK I HAVE A GOOD REASONING FOR THIS OKAY... mainly that i dodnt want to paste the complete reply every time especially in case#it ends up being quite a bit longer#its more like i grabbed python for slime-exe running on desktop#and i took more of the aesthetic of the languade than a direct thing if that makes sense sjfbJdbsj#although if theres a command that maybe runs a pre-set function i could use that instead?#<- doesnt really know much about python T^T#input: ask
4 notes
·
View notes
Text
Turns out coding is like writing and drawing (I desperately want to do it but then while I’m doing it I’m like ugh I hate this).
#quigs says#coding#im very very bad btw#currently trying to naughts and crosses in python using inputs and turtle and way too many functions
2 notes
·
View notes
Text
There’s something g so funny to me about consuming older comedy for the first time and discovering how long we’ve been making jokes about things. Like when I was 15 my social studies teacher put on Monty Python and The Holy Grail as the “end of year, exam review is over, I don’t wanna teach anymore” movie and I remember hearing some of the jokes and being mad surprised about them. I just remember going to myself “this is from the sixties? I didn’t think you were allowed to talk about eating pussy in movies back then?” Same goes for most Monty Python stuff tbh. I always knew it was rather lewd stuff, and I had always associated it with the 80s, since I was used to that being raunchy comedy times. But I got hit with that 1975 release date and went “okay I was a little off on the time there but STILL!”
And I still get times like that. Like I know dick jokes are timeless, but I recall seeing Pompeii graffiti and finding other non penis jokes surprisingly modern seeming. Finding 69 jokes in a Navy ID for a ship cat from the 40s. I dunno, something about the way we’ve always been making dirty jokes but also the way we seem to still treat dirty jokes like they’re a new thing pushing the envelope.
#scream rambles#comedy#history#dirty jokes#monty python#also yeah I know my history teacher made a wildly questionable choice in movies to show#the man’s life was in shambles and he had tenure at the school#guy kinda just did what he wanted and barely constituted as a functioning adult human let alone a teacher
9 notes
·
View notes
Text
holy shit python allows me to turn string variables trans
#qrevo.txt#python being based. as always#there are chemicals in the functions turning all the variables trans#i'm soo sleepy idk how i'm still powering through this project
3 notes
·
View notes