Python Turtle Program To Creating Graph Paper

Python Code import turtle trtl=turtle.Turtle() trtl.speed(10) for i in range(0,400,20): trtl.pencolor('lightgrey') trtl.penup() trtl.setpos(-200+i,-200) if i==0: trtl.left(90) trtl.pendown() trtl.forward(400) trtl.backward(400) for i in range(0,400,20): trtl.pencolor('lightgrey') trtl.penup() trtl.setpos(-200,-200+i) if i==0: trtl.right(90) trtl.pendown() …

Read more

Python Turtle Program To Draw Radha Krishna

Python Code import turtle turtle.bgcolor('#FFCA8A') turtle.title("Radhe Krishna") screen= turtle.Screen() screen.setup(650,580) t1 = turtle.Turtle() t1.speed(4) t1.right(90) t1.pu() t1.forward(180) t1.left(90) t1.pd() t1.fillcolor("#A6F1B9") t1.begin_fill() t1.forward(400) t1.right(90) t1.forward(100) t1.right(90) t1.forward(800) t1.right(90) t1.forward(100) t1.right(90) t1.forward(400) …

Read more

Python Turtle Program Colorful Flower Design

Python Code import turtle turtle.setup(width=600, height=500) turtle.reset() turtle.hideturtle() turtle.speed(0) turtle.bgcolor('black') c = 0 x = 0 colors = [ #reddish colors (1.00, 0.00, 0.00),(1.00, 0.03, 0.00),(1.00, 0.05, 0.00),(1.00, 0.07, 0.00),(1.00, …

Read more

Python Turtle Program To Draw Doraemon

Python Code from turtle import * import turtle wn = turtle.Screen() wn.setup(width=1000, height=800) def my_goto(x, y): penup() goto(x, y) pendown() def eyes(): fillcolor(“#ffffff”) begin_fill() tracer(False) a = 2.5 for i …

Read more

Java Program To Get Screen Size

Example import java.awt.Toolkit; import java.awt.Dimension; public class javaScreenSizeExample { public static void main(String[] args) { Toolkit toolkit = Toolkit.getDefaultToolkit(); Dimension screenSize = toolkit.getScreenSize(); System.out.println("Screen size: " + screenSize.width + "x" …

Read more

Java Program To Perform Bubble Sort

01. Example: import java.util.Scanner; class bubbleSort { public static void main(String[] args) { int n, c, d, swap; Scanner in = new Scanner(System.in); System.out.println("Input number of integers to sort: "); …

Read more

Java Program To Perform Binary Search

01. Example: import java.util.Scanner; class BinarySearch { public static void main(String args[]) { Scanner in = new Scanner(System.in); System.out.println("Enter number of elements in the array: "); int numberOfElements = in.nextInt(); …

Read more

Java Program to Do Date Format and Manipulation

01. Example: import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class simpleDateFormatManipulation { public static void main(String[] args) { Date date = new Date(); System.out.println("Date Format And Manipulationn___________________________________"); SimpleDateFormat …

Read more

Java Program To Convert String Into Sql Date

01. Example: import java.sql.Date; public class StringToSQLDateExample { public static void main(String[] args) { String dataString = "2023-02-12"; Date sqlDate = Date.valueOf(dataString); System.out.println(sqlDate); } } Output: 2023-02-12 This Java code …

Read more