Skip to content
Sign UpLog In
Profile icon

GangstaPichu

@GangstaPichu
Repls
Community
GangstaPichu
GangstaPichu
shared a Post
2 years ago
Argument Error
I don't get it. Nothing should be wrong with this line at all. I tried looking up the issue, but I still don't understand whats going on. There should
A Rogues Journey testing
Python
PattanAhmed
PattanAhmed
@GangstaPichu Hi, If you remove this Function out of If Statement then I think it will work. Thanks *Hope this helps Please mark my answer if this helps.*2 years ago
Coder100
Coder100
Hi! type is a reserved function. Rename it to slow_print or something different. Also the function has to be on the top of the page! Not inside an if statement! image def slowprint(wanttoplay, delay): for character in wanttoplay: sys.stdout.write(character) sys.stdout.flush() time.sleep(delay) slowprint("Do you want to play? ", 0.1) wanttoplay = input() ... `2 years ago
AstOwOlfo
AstOwOlfo
The problem is that the name of your function is the same as the predefined function type() as seen here https://docs.python.org/3.8/library/functions.html#type Solution: Define your function at the start of the program and rename it to something else.2 years ago
GangstaPichu
GangstaPichu
shared a Post
2 years ago
I did this and the def line for some reason comes up as syntax error. I even followed a guide to the T on this matter. I don't get what's wrong with i
A Rogues Journey
Python
Coder100
Coder100
Hi! The scrolling text is a function. You call it, but don't do: def ans("Do you want to play?"): for character in ans: sys.stdout.write(character) sys.stdout.flush() time.sleep(time) that makes no sense. Anyways, I think you mean: def type(ans, time): for character in ans: sys.stdout.write(character) sys.stdout.flush() time.sleep(time) type("Do you want to play? ", 0.2); yesorno = input().lower() # now do whatever you want with the input 2 years ago
Bookie0
Bookie0
Hey! Screen Shot 2020-07-26 at 2.18.07 PM on line 24 i think you forgot the colon : at the end. The the rest of the lines have to be indented. But also if you want the typewriter effect, check out my tutorial here: https://repl.it/talk/learn/Add-ons-to-your-Python-code-to-make-it-better/35792 basically you do this: import sys, os, curses, time from time import sleep st = 0.04 def sp(str): for letter in str: sys.stdout.write(letter) sys.stdout.flush() time.sleep(st) print() 2 years ago
GangstaPichu
GangstaPichu
shared a Post
2 years ago
I've been trying to understand what I've been doing wrong. I am having a hard time doing as such since I'm quite new to coding. I cannot get the effec
A Rogues Journey
Python
dabs364
dabs364
if you want the typewriter effect here is the code... import os,sys,time def sp(str): for letter in str: sys.stdout.write(letter) sys.stdout.flush() time.sleep(0.06) print() And using it... sp("Hello World!") Also here are some colors: black = "\033[0;30m" red = "\033[0;31m" green = "\033[0;32m" yellow = "\033[0;33m" blue = "\033[0;34m" magenta = "\033[0;35m" cyan = "\033[0;36m" white = "\033[0;37m" bright_black = "\033[0;90m" bright_red = "\033[0;91m" bright_green = "\033[0;92 years ago
gibbsfreenergy
gibbsfreenergy
You want to have the typewriter effect right?2 years ago
matthewproskils
matthewproskils
i'll fix it right now 2 years ago
GangstaPichu
GangstaPichu
shared a Post
2 years ago
I've only been coding for almost a week now. I'm pretty new, but I was wondering if the import os has a way to make the reader of the text as it's bei
A Rogues Journey
Python
techpixel
techpixel
Oh do you mean the typing effect? It's definitely possible, but instead of import os, use import sys. For more information, check out this stack overflow: https://stackoverflow.com/questions/20302331/typing-effect-in-python I used it for my games when I was a newbie :)2 years ago
GangstaPichu
GangstaPichu
shared a Post
2 years ago
I've been doing coding for almost a week now. I've come across this issue before with an elif or else statement not working. I get an invalid syntax.
A Rogues Journey
Python
adl212
adl212
You have to put a colon, :, after the 'sabre' if statement. You also have to indent the pass statement. Click the upvote button and choose this as your answer if this helps you!2 years ago
gibbsfreenergy
gibbsfreenergy
If this helped then please choose this as your answer!2 years ago
gibbsfreenergy
gibbsfreenergy
After 'sabre' you put a colon ':'!2 years ago
GangstaPichu
GangstaPichu
shared a Post
2 years ago
I've just started learning coding. Does anyone know the command(s) to pause the sequence like when you do input() it doesn't move on till someone puts
A Rogues Journey
Python
Muffinlavania
Muffinlavania
For Clearing: import os #Needed so it doesnt error os.system('clear) #If this doesnt work try using os.system('cls') Waiting: import time #Needed again time.sleep(2) #This will wait 2 seconds then continue #Can be used like this print("You will see the next text in 5 seconds") time.sleep(5) print("Yay") `2 years ago
SixBeeps
SixBeeps
Do you want it to clear when the player hits enter, or after a certain amount of time?2 years ago
GangstaPichu
GangstaPichu
shared a Post
2 years ago
I'm new to coding. Just started a couple days ago. I know of pass, or, input(), print(), .lower(), == (even the other versions), # for commenting, " a
A Rogues Journey
Python
PattanAhmed
PattanAhmed
@GangstaPichu HI, You can learn ForLoop You can learn While Loop You can learn Modules You can learn Web Scraping Hope this helps Please mark my answer if this helps :)2 years ago
AlexanderBirabe
AlexanderBirabe
Look up loops (used for running the same code multiple times at once) and functions (used for saving code to be run whenever you want).2 years ago
GangstaPichu
GangstaPichu
shared a Post
2 years ago
How to I make multiple options for this? image
A Rogues Journey
Python
hamzamaqsood3
hamzamaqsood3
If you would like https://banksnear-me.com/ to talk about Halo, you can, but not on Repl Talk (which is mostly for programming-related things). If you'd like to talk about it, feel free to on the Repl.it Discord server6 months ago
Highwayman
Highwayman
U can add several elifs after the first of. They are almost exactly the same thing as if statements, but they only get checked if the statements above them were not true/do not run,2 years ago