Share your repls and programming experiences

← Back to all posts
TheBorg0919 (28)

This is a simple phone-ish kind of program. You can use a calculator, play a guessing game, or log something on it. I'm learning Python, so I decided to make this small project as kind of a landmark of my progress on learning Python.

AdCharity (944)

would add some sort of loop to continue after doing a task

PantheraLeo04 (1)

try using replit.clear() to erase the terminal and random.randint() to have the user guess a random word

To all the people telling me to use os, I never learned the os module only replit

JacksonCowie (209)

@PantheraLeo04 Better to import the os module and use os.clear(), just makes it compatible for desktop.

TaylorLiang (656)

@JacksonCowie finally, somebody that agrees that os is superior

Warhawk947 (257)

@TaylorLiang you could also do os.system('cls' if == 'win' else 'clear')

TaylorLiang (656)

Dont use win, use nt instead.

Warhawk947 (257)

@TaylorLiang ok (I thought it was win I never tested it oof)

Thecrowbar1234 (63)

@JacksonCowie I usually use replit clear, but i would recommend os clear

Ganesha1 (7)

I made something similar to this in batch.


@echo off
color 0a
title Booting up...
echo Finding System Disk...
ping n->nul
ping n->nul
echo Found Operating System Boot Disk
echo Starting up...
echo Starting up... 1 percent
echo Starting up... 5 percent
echo Starting up... 10 percent
echo Starting up... 15 percent
echo Starting up... 20 percent
echo Starting up... 25 percent
echo Starting up... 30 percent
echo Starting up... 35 percent
echo Starting up... 40 percent
echo Starting up... 45 percent
echo Starting up... 50 percent
echo Starting up... 75 percent
echo Starting up... 95 percent
echo Starting up... 100 percent!
goto login
echo What is your Password?
set /p pword=

echo Hello there!
echo Open a program:
echo 1 is for calculator
echo 2 is for clock
echo 3 is for antivirus
echo 4 is for browser
echo 5 is for text editor
echo 6 is for zombie attack.
set /p desktopick= Type Number Here:
if %desktopick%==1 goto calc
if %desktopick%==2 goto clock
if %desktopick%==3 goto antivirus
if %desktopick%==4 goto browser
if %desktopick%==5 goto textedit
if %desktopick%==6 goto zombiegame
@echo off
title CMD Calculator
color 1f
echo -------------------------------------------
echo Welcome to CMD Calculator
echo -------------------------------------------
set /p sum=
set /a ans=%sum%
echo = %ans%
echo -------------------------------------------
echo Previous Answer: %ans%
goto top
echo Time: %time%\
ping -n 2>nul
goto main
@echo off
title Antivirus
echo Antivirus
echo created by Ganesha

IF EXIST virus.bat goto infected
IF NOT EXIST virus.bat goto clean
cd c:\windows\system32
del virus.bat
goto start
@echo off
color 7
echo Welcome to Ion Browser
echo Type a URL below.\
set /p sitename=
start %sitename%
goto loop
@echo off
echo Text generator!!!
echo -----------------
echo Type in your text
set /p text=
echo Your text is:
echo %text%
echo -----------------
echo Just copy and paste your text into notepad.
start notepad.exe
@echo off

title Zombie Attack
echo Welcome to Zombie Attack!
echo In this game you have to fight zombies.
echo (1) Begin

set /p choice1=Choose-
if %choice1% == goto g

title Battle
echo Entering Battle...
echo You find a strange man in the woods,
echo you think that he is just a man, but really, he's a zombie!
echo Entering Battle...
goto h
title Battle
echo Zombie uses Bite!
your health fell by -shp
echo You have 3 attacks
echo (1) Punch
echo (2) Slap
echo (3) Kick in the butt

set /p choice2=choose-
if %choice2% == 1 goto i

if %choice2% == 2 goto j
if %choice2% == 3 goto k
echo You used Punch.
echo zombie's health fell by 14hp!
echo Congrats!
echo You beat the zombie!
echo You used Slap.
echo zombie's health fell by 8hp!
echo Congrats!

echo You beat the zombie!
echo You used Kick in the butt.
echo zombie's health fell by 18hp!
echo Congrats!
echo You beat the zombie!

DmitryBolsoni (0)

Should of called it a pYphone

Unorthodox (8)

For the guessing game, I suggest you make an array or tuple containing a list of animals, then use random.choice() from the random module to choose a random one out of that list. Also, write a while loop to keep running the phone after you use one of its functions, and add an option to break out of that loop.

TheBorg0919 (28)

@Unorthodox thats a great idea but im learning python so i might add that in the future?