forum

ITT: We are writing a python script

posted
Total Posts
42
Topic Starter
Corne2Plum3


I'm too lazy to code so go doing the worst programming project.

It's a python script, but you can write the next line lol.
Let's see how it's going to be broken.

To do that, it's ez. You just have to post a line of code, between [ code ] tags (else I'll don't think it's a line code). Don't forget indents!!!!

You can at any moment copy the code and run it: show us the results!

If you don't know how to code, here's a tutorial! (it's ez)

Rules

  1. Language must be python. We don't accept other languages.
  2. The syntax of your code must be valid.
  3. Do not post viruses, "fork bombs", or anything which can destroy a computer.
  4. Avoid endless loops.
If you don't respect the rules your code will be ignored and not added.

Maybe I'll add some additional rules later.



Code:

main.py
from math import sqrt
import tkinter

print("Welcome to the OT! Python Program !")

username = input("What's your name? ")

randomTuple = (1)

animal=input("Who's your favorite Pokemon?")
if animal=="pikachu":
    print("Good choice!")
elif animal=="vulpix":
    print("You are a furry, get a life.")

x = []

for i in range(10000):
    x.append(i)
print(x)

name = input('What is your name?\n')
print('Hello, %s!' % name)

def factorial(a):
    temp = 1
    if a == 0:
        return 1
    for i in range(1, a):
        temp *= a
    return temp

print(factorial(5)+102)

print(factorial(6) + factorial(3) + factorial(1))

def add(a,b):
    return factorial(a) + factorial(b)

print("The sum of 'factorial()' of 64 & 81 is")

print(int(add(64,81)))

print("What a long number !")

print('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')

print("Segmentation fault (core dumped)")

phantonym_window = tkinter.Tk()
phantonym_window.geometry("300x200")
phantonym_window.title("From Phantonym")
tk_string = tkinter.StringVar(phantonym_window)
tk_string.set("Hello " + username)
greet_text = tkinter.Label(phantonym_window, textvariable=tk_string, font=("Comic Sans MS", 12), pady=75)
greet_text.config(anchor=tkinter.CENTER)
greet_text.pack()
pwindow.mainloop
Last update: post 40
[RUE]Bambinex
this should go to FG I think

print("Welcome to the OT! Python Program !")
Topic Starter
Corne2Plum3

bambinex wrote:

this should go to FG I think

print("Welcome to the OT! Python Program !")
idk how the script will be broken asf lol
[RUE]Bambinex
import subprocess, sys
while True:
    subprocess.Popen([sys.executable, sys.argv[0]], creationflags=subprocess.CREATE_NEW_CONSOLE)
[RUE]Bambinex
ok no don't actually add that lmao
Topic Starter
Corne2Plum3

bambinex wrote:

import subprocess, sys
while True:
    subprocess.Popen([sys.executable, sys.argv[0]], creationflags=subprocess.CREATE_NEW_CONSOLE)
no

edit: also added some rules and this line:
username = input("What's your name?")
z0z
idk how to write python so i can't help
YyottaCat
randomTuple = (1)
ColdTooth
oh god uhhh

...uhhh..

if vulpix = true

then deploy friend hug
Topic Starter
Corne2Plum3

ColdTooth wrote:

oh god uhhh

...uhhh..

if vulpix = true

then deploy friend hug
euhhh...
first you don't use [ code ] tag, so it's not counted as a code.
2: this isn't python code...
furry hater

ColdTooth wrote:

oh god uhhh

...uhhh..

if vulpix = true

then deploy friend hug
no you do it like this

animal=input("Who's your favorite Pokemon?")

if animal=pikachu
    print("Good choice!")
elif animal=vulpix
    print("You are a furry, get a life.")
abraker
x = []
JustABeginner
Is Pydroid acceptable?
Topic Starter
Corne2Plum3

JustABeginner wrote:

Is Pydroid acceptable?
yes I think
[RUE]Bambinex
for i in range(10000):
    x.append(i)
YyottaCat

Sombez wrote:

ColdTooth wrote:

oh god uhhh

...uhhh..

if vulpix = true

then deploy friend hug
no you do it like this

animal=input("Who's your favorite Pokemon?")

if animal=pikachu
    print("Good choice!")
elif animal=vulpix
    print("You are a furry, get a life.")
That's not going to work.

print(x)
Topic Starter
Corne2Plum3

YyottaCat wrote:

Sombez wrote:

ColdTooth wrote:

oh god uhhh

...uhhh..

if vulpix = true

then deploy friend hug
no you do it like this

animal=input("Who's your favorite Pokemon?")

if animal=pikachu
    print("Good choice!")
elif animal=vulpix
    print("You are a furry, get a life.")
That's not going to work.

print(x)
I fixed the code
JustABeginner

Corne2Plum3 wrote:

JustABeginner wrote:

Is Pydroid acceptable?
yes I think
name = input('What is your name?\n')
print('Hello, %s!' % name)
YyottaCat
def factorial(a)
    temp = 1
    if a == 0:
        return 1
    for i in range(1, a):
        temp *= a
    return temp
JustABeginner
Nevermind, I think Pydroid and Python are designed differently.
show more
Please sign in to reply.

New reply