Bank Account Class

A bank account simulation

class Bank_Account: def __init__(self): self.balance=0 print("Hello!!! Welcome to the Bank") def deposit(self,amount): self.balance += amount print("\n Amount Deposited:",amount) def withdraw(self,amount): if self.balance>=amount: self.balance-=amount print("\n You Withdrew:", amount) else: print("\n Insufficient balance ") def display(self): print("\n Net Available Balance=",self.balance) account1 = Bank_Account() account1.deposit(500) account1.withdraw(200) account1.display()

Spiral Square

Endless square spiral in turtle

from turtle import * bgcolor("blue") shape("turtle") color("green") begin_fill() side=400 penup() goto(-200,-200) pendown() for i in range (1,100): forward(side) left(90) side=side-4

Python Generated House

A house I created using Turtle

from turtle import * screen = Screen() screen.setup(900,900) bgcolor("blue") color("white") shape("turtle") penup() goto(-400,-400) pendown() begin_fill() for i in range(4): forward(300) left(90) penup() goto(-400,-100) pendown() left(60) forward(300) right(120) forward(300) penup() right(30) goto(-250,-400) pendown() right(90) for i in range(4): forward(25) right(90) forward(130) penup() goto(-300,-200) pendown() for i in range(4): forward(50) right(90) penup() goto(-325,-200) pendown() right(90) forward(50) penup() goto(-300,-175) left(90) pendown() forward(50) penup() goto(-150,-300) pendown() begin_fill() for i in range(360): forward(0.1) left(1) end_fill() penup() goto(0,0)
Akshay Jun 05

This is amazing!