Jump to content

can someone tell me whats wrong with this code its not working its for a school project

kingash44
 Share

Import turtle
tur.color('cyan')
style=('courier',30,'bold')
tur.write('sikkim',font=style,align='centre')
tur.hideturtle()
tur.done()

Link to comment
Share on other sites

Link to post
Share on other sites

Could you elaborate on what isn't working? Does it crash, do you get an error message, is something else happening?

 

P.S. the forum has code tags (the <> icon) that allows you to paste code in a better readable manner.

Crystal: CPU: i7 7700K | Motherboard: Asus ROG Strix Z270F | RAM: GSkill 16 GB@3200MHz | GPU: Nvidia GTX 1080 Ti FE | Case: Corsair Crystal 570X (black) | PSU: EVGA Supernova G2 1000W | Monitor: Asus VG248QE 24"

Laptop: Dell XPS 13 9370 | CPU: i5 10510U | RAM: 16 GB

Server: CPU: i5 4690k | RAM: 16 GB | Case: Corsair Graphite 760T White | Storage: 19 TB

Link to comment
Share on other sites

Link to post
Share on other sites

what r u trying to do? error message please

Link to comment
Share on other sites

Link to post
Share on other sites

ooh i think its cuz u put import turtle instead of "Import turtle as tur" you kept putting tur.(code) instead of turtle.(code) python doesnt understand what your doing are you cheating online lol? anyways when you put tur python doesnt recognize it you have to use as tur instead of import as turtle for example "Import turtle as tur" then python will recognize turtle as tur. Maybe that's whats wrong with your code, can you give the full code please?

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, tikker said:

Could you elaborate on what isn't working? Does it crash, do you get an error message, is something else happening?

 

P.S. the forum has code tags (the <> icon) that allows you to paste code in a better readable manner.

sorry i dont understand

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, DietzDiet said:

what r u trying to do? error message please

its keep closing

 

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, kingash44 said:

sorry i dont understand

he wants you to explain more

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, DietzDiet said:

ooh i think its cuz u put import turtle instead of "Import turtle as tur" you kept putting tur.(code) instead of turtle.(code) python doesnt understand what your doing are you cheating online lol? anyways when you put tur python doesnt recognize it you have to use as tur instead of import as turtle for example "Import turtle as tur" then python will recognize turtle as tur.

can you correct the code and  quote this topic please i dont know coding

 

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, kingash44 said:

can you correct the code and  quote this topic please i dont know coding

 

what grade r u in btw and isnt it for school? i can teach u i am also new to coding i recently just started to understand turtle

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, kingash44 said:

its keep closing

 

OH you hadnt assinged a screen bruh do this:

import turtle as tur

screen = turtle.screen
tur.color('cyan')
style=('courier',30,'bold')
tur.write('sikkim',font=style,align='centre')
tur.hideturtle()
tur.done()



does it work? and can you give me the full code? btw are u using pycharm or smth else

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, kingash44 said:

its for my niece am an accountant

the frick? why r u doing ur niece's work?? anyways 

 

import turtle as tur

screen = tur.screen
tur.color('cyan')
style=('courier',30,'bold')
tur.write('sikkim',font=style,align='centre')
tur.hideturtle()
tur.done()
screen.exitonclick()


make sure your screen is exitonclick otherwise it will close instantly

 

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, DietzDiet said:

OH you hadnt assinged a screen bruh do this:

Import turtle as tur

screen = turtle.screen
tur.color('cyan')
style=('courier',30,'bold')
tur.write('sikkim',font=style,align='centre')
tur.hideturtle()
tur.done()


does it work?

 

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, kingash44 said:

can you correct the code and  quote this topic please i dont know coding

 

If we don't know what is going wrong, then we don't know what to correct.

5 minutes ago, kingash44 said:

its keep closing

 

How are you running it?

 

As mentioned above, one issue is that you import "turtle" but keep referring to it as "tur". Either you need to "import turtle as tur" or replace all "tur" with "turtle".

Crystal: CPU: i7 7700K | Motherboard: Asus ROG Strix Z270F | RAM: GSkill 16 GB@3200MHz | GPU: Nvidia GTX 1080 Ti FE | Case: Corsair Crystal 570X (black) | PSU: EVGA Supernova G2 1000W | Monitor: Asus VG248QE 24"

Laptop: Dell XPS 13 9370 | CPU: i5 10510U | RAM: 16 GB

Server: CPU: i5 4690k | RAM: 16 GB | Case: Corsair Graphite 760T White | Storage: 19 TB

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, kingash44 said:

 

btw can you paste the full script so i can help u more

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, DietzDiet said:

btw can you paste the full script so i can help u more

Import turtle
tur.color('cyan')
style=('courier',30,'bold')
tur.write('sikkim',font=style,align='centre')
tur.hideturtle()
tur.done()

Link to comment
Share on other sites

Link to post
Share on other sites

9 minutes ago, DietzDiet said:

btw can you paste the full script so i can help u more

question is

import the turtle module and write sikkim using the python turtle in diffrent colors

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, kingash44 said:

question is

import the turtle module and write sikkim using the python turtle in diffrent colors

alr so u want the colors to randomly change?

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, DietzDiet said:

alr so u want the colors to randomly change?

yes

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, kingash44 said:

yes

it will be a little bit hard but i have a rgb color list btw u just assigned the color to a plain color, cyan btw this is the rgb list  
 

list = [(225, 156, 75), (33, 95, 140), (127, 184, 208), (222, 207, 106), (25, 52, 73), (223, 78, 51), (165, 21, 43), (142, 98, 42), (183, 47, 80), (125, 196, 140), (206, 129, 158), (37, 134, 48), (103, 11, 55), (206, 91, 106), (139, 178, 46), (146, 207, 222), (54, 54, 84), (76, 31, 23), (28, 156, 170), (9, 79, 116), (83, 73, 40), (227, 181, 160), (220, 174, 183), (160, 208, 177), (86, 159, 111), (107, 123, 156)]
Link to comment
Share on other sites

Link to post
Share on other sites

13 minutes ago, kingash44 said:

yes

import turtle as tur
import random as r
tur.colormode(255)
list = [(225, 156, 75), (33, 95, 140), (127, 184, 208), (222, 207, 106), (25, 52, 73), (223, 78, 51), (165, 21, 43), (142, 98, 42), (183, 47, 80), (125, 196, 140), (206, 129, 158), (37, 134, 48), (103, 11, 55), (206, 91, 106), (139, 178, 46), (146, 207, 222), (54, 54, 84), (76, 31, 23), (28, 156, 170), (9, 79, 116), (83, 73, 40), (227, 181, 160), (220, 174, 183), (160, 208, 177), (86, 159, 111), (107, 123, 156)]

screen = tur.Screen()

tur.color(r.choice(list))
style = ('Courier', 30, 'bold')
tur.write('sikkim', font=style, align='center')
tur.hideturtle()


screen.exitonclick()



i added a few tweaks i got help from this website
Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×