This program is going to be the first thing I'm writing for the game jam. Even though this is like a twelve-liner, I honestly can't tell you how much
ArchieMaclean Here is a link to the fixed repl. Please upvote if this helps :)4 years ago
mrfibo123 You have a print statement that isn't indented on line 13 and if you want to indent the 'if' statement then you should indent print or not indent "if". I assume you want to indent it all instead though because its supposed to loop. You also need to flip the "an" and "bet" in the if statement. I've fixed it in a fork of the original code here:https://repl.it/@mrfibo123/Endless-heads-or-tails-14 years ago
This simple, but 'decorative' drawing is done when I tried to create a 'boucing ball' program, but the ball seems to levitate each time it lands. I al
Python (with Turtle)
I am really basic to python and even though I do know which modules for different jobs, I don't know about the string module. Please help me!
Geocube101 The split() function is built in and doesn't require a module Syntax: string.split(sep, maxcount) where string is the string to modify, sep is the sub-string to split around, and maxcount is the amount of times to split the string. max_count is optional and if left blank, will split the string by every occurrence of the sub-string #Examples str1 = 'this is cool' str1.split(' ') #=> ['this', 'is', 'cool'] str1.split(' ', 1) #=> ['this', 'is cool'] `4 years ago
For some random reason, line 16 doesn't work (could be multiple lines of code with the same problem) and I have proof-readed it to my best shot and it
themaka The others have already answered, but just to make sure it's clear. Using a single equal sign means you are setting a value. x = 5 When you want to compare, like in an if statement, you have to use two equal signs if x == 5: #do something4 years ago
AzureScripts You did it wrong! You need to have 2 equal signs (==) when you are doing 'if' stuff if thing1 == "A": do stuff here4 years ago
Geocube101 If conditional requires two equal signs if this == that: #Do This `4 years ago
First, you have to import random and time. When you have finished, type in time.sleep(5) We're using this to prevent a sudden crash. You should now ty
FelixMandein it worked 2 years ago
Nanashi If your system is literally crashing after importing modules without the use of time.sleep(1), something's wrong. And what is random for? If this post isn't a joke, it is nonsensical, to put it bluntly. The script doesn't even match what the text is saying. What is range()? It is an object representing an immutable sequence of integers but isn't a list. list() converts an iterable into a list. So we have: print(list(range(1,1001))). Another way to create a list of numbers 1-1000 is to use a fo4 years ago
Even though I am a dummy when it comes to AI, I managed to create a REPL which has basic AI functions in. Hope you enjoy!
First, you import turtle and type t = turtle.Turtle. Make a empty line and type t.circle.
themaka Hi there madmonster -- we're ok with small simple tutorials, but this one and the last one are pretty much the same thing. How about you right a long in-depth tutorial on drawing several shapes with Turtle? (Also, you didn't include a link to your repl here).4 years ago
First, you import turtle and do t = turtle.turtle() Then you do FOR loop repeating 4 times.(0,4 or 1,5) If you don't know how to make loops, here is h
First, import random (or you can just import the 'randint' function) After you finished that, make an empty line. For our final line, print random.ran
I learnt python from a book which is outdated. It was a book published in 2013 and its IF statements that don't work.
TatumBanks I keep forgetting a lot of things to Replit such as variables if statements etc.1 year ago
UNDeF1ND if (boolean): and then the if statement will indent. backspace to stop it.2 years ago
EDJ102 Python is always updating, so that is why your if\else commands are not working.2 years ago
This REPL uses %s statements to create a program with a imaginary robot called 'Ben The Bot' who asks you questions - all without a single IF statemen