This Python program will need to include the following items listed below. You are to customize your program and create the sequence in any order of your choice.
source code in plain text:
import turtle
wn = turtle.Screen()
laugh= turtle.Turtle()
laugh.penup()
laugh.goto(-75,150)
laugh.pendown()
laugh.circle(10)
laugh.penup()
laugh.goto(75,150)
laugh.pendown()
laugh.circle(10)
laugh.penup()
laugh.goto(0,0)
laugh.pendown()
laugh.circle(100,90)
laugh.penup()
laugh.goto(0,0)
laugh.pendown()
laugh.circle(-100,90)
p=("Rgukt","Nuzvid","Andhrapradesh") #declareing constant variables
in tuple in tuple we didnt modify the values
Total_amount=int(input("Enter Total amount")) #take total amount aS
INPUT
percentage=int(input("Enter your percentage")) #take percentage
share
output_amount=(percentage/100)*Total_amount #output of the
percentage amout he/she get
print(output_amount)
#if_else conditions
name=input("Enter your name")
if(name=="Chandhu"):
print("you are administrator at "+p[0]+" "+"in
"+p[1])
elif(name=="Raghu"):
print("you are doctor at"+p[1]+" "+"in "+p[2])
elif(name=="madhu"):
print("you are Teacher at "+p[1]+" "+"in "+p[2])
else:
print("you are may be student at"+p[0]+" "+"in
"+p[1])
#for loop
for i in range(1,10,1):
print(i) #here print the values from 1 to 9 to iterate
over the for loop
#while loop
i=0
while(i<10): #loop iterate to until i value <10 if the value
>=10 it breaks
print(i) #each iteration time print i value
i=i+1 #increment the i value for iteration
#second while loop
i=1
while(i<=10): #here print 1 to 10 even and odd numbers
print
if(i%2==0):
print(i,":even") #if i%2==0 it is
even number so it will execute
else:
print(i,":odd") #if i%2==1 it will
be odd number
i=i+1
#instance list looping
list=[5,6,7,8,9]
for i in list: #iterate the values over the list
print(i)
#two functions
def add(a,b): #declare the fucntion and pass two parameters
return a+b #return sum of ther two parameters
def name(a):
return a
print(add(1,2)) #passing arguments
print(name("vishnu")) #passing arguments
#logical operators
a=10
b=20
c=30
if(a<=b and a<=c):
print(a,":smallest number")
elif(b<=a and b<=c):
print(b,":smallest number")
else:
print(c,":smallest number")
#if you have any doubts comment below...
This Python program will need to include the following items listed below. You are to customize your program and create the sequence in any order of your choice. Must include Python comments for each...
This Python program will need to include the following items listed below. You are to customize your program and create the sequence in any order of your choice. Write in simple code. Must include Python comments for each of the items show below. Calculate a Percentage. For example, the discount percentage on a sale item. Use of 3 Constants. To be used for values that will not change throughout the life of the program. A Turtle Graphic Logo. This logo...
Design an original, professional web site following the specifications listed below. This web site will be for a business you plan to set up for yourself or for someone else. The following is a detailed list of the requirements for your web site. READ them carefully. Instructions - Web Site Requirements for the web site: General: You will thoroughly test all your pages in more than one browser. All links MUST work. All graphics must show on the page. All...
Modify your program from Learning Journal Unit 7 to read dictionary items from a file and write the inverted dictionary to a file. You will need to decide on the following:How to format each dictionary item as a text string in the input file.How to covert each input string into a dictionary item.How to format each item of your inverted dictionary as a text string in the output file.Create an input file with your original three-or-more items and add at...
You need not run Python programs on a computer in solving the following problems. Place your answers into separate "text" files using the names indicated on each problem. Please create your text files using the same text editor that you use for your .py files. Answer submitted in another file format such as .doc, .pages, .rtf, or.pdf will lose least one point per problem! [1] 3 points Use file math.txt What is the precise output from the following code? bar...