






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







print("Hello World!")
name = input("What is your name? ")
print("Hello, " + name + "!")
number = int(input("Enter a number: "))
if number % 2 == 0 : print("The number is even.") else: print("The number is odd.")
number = int(input("Enter a number: ")) if number % 2 == 0 : print("The number is even.") else: print("The number is odd.")
number1 = float(input("Enter the first number: ")) number2 = float(input("Enter the second number: ")) result = number1 + number print("The sum of the two numbers is:", result)
number1 = float(input("Enter the first number: ")) number2 = float(input("Enter the second number: ")) number3 = float(input("Enter the third number: ")) average = (number1 + number2 + number3) / 3 print("The average of the three numbers is:", average)
number = float(input("Enter a number: ")) if number > 0 : print("The number is positive.") elif number < 0 : print("The number is negative.") else: print("The number is zero.")
import turtle
t = turtle.Turtle()
t.forward( 100 ) # Moves forward 100 pixels t.left( 90 ) # Turns 90 degrees t.forward( 100 )
turtle.done()
turtle.end_fill() # Ends the color filling once the polygon is complete
window = turtle.Screen() # Creates a new Turtle window for drawing turtle.speed( 3 ) # Sets the turtle's drawing speed
polygon("blue", 5 , 100 ) # Uses the function to draw a blue pentagon window.mainloop() # Keeps the window open to display the drawing
different