Homework Help Question & Answers

USING PYTHON LANGUAGE. QUESTION I: Write a program that displays the following table: a a^2 a...

QUESTION I: Write a program that displays the following table: a a^2 a 3 a14 1 1 1 1 2 4 8 16 3 9 27 81 4 16 64 256 QUESTIONUSING PYTHON LANGUAGE.

QUESTION I: Write a program that displays the following table: a a^2 a 3 a14 1 1 1 1 2 4 8 16 3 9 27 81 4 16 64 256 QUESTION II: An approximate value of a number can be computed using the following formula: 7 ) Write a program that displays the result of 4 X + 7 • H) and 4 X - 를 7 tis). 9 QUESTION III: Write a program that prompts the user to enter a six-digit integer and displays the number in reverse order. (Don't use indexing. You can use arithmetic operation.) Here is a sample run: Enter an integer: 673248 6 7 3 2 4 8 QUESTION IV: Write a program that receives a character and displays its UNICODE code. For example, if the user enters $, the program displays the character 351. Here is a sample run: Enter a character: $ The UNICODE of character is 351 QUESTION V: Write a program that generates figures A and B by using the turtle graphics library. Square Circle e Triangle Rectangle Figure A Figure B
0 0
Add a comment
Answer #1

1.

print("a\ta^2\t^a^3\ta^4")
for i in range(1,5):
    print(i,"\t",i*i,"\t",i*i*i,"\t",i*i*i*i)

2.

print("approximate value of pie using 4*(1-1/3+1/5-1/7+1/9-1/11) is : ", 4*(1-1/3+1/5-1/7+1/9-1/11) )
print("approximate value of pie using 4*(1-1/3+1/5-1/7+1/9-1/11+1/13-1/15) is : ", 4*(1-1/3+1/5-1/7+1/9-1/11+1/13-1/15) )    

3. Here, it is asked to return reverse order but in example it is shown in the normal order , but I have done coding for both reverse order and normal order

number = int(input("Enter a 6 digit number : "))

new_number = 0
print("numbers in reverse order")
while(number>0):
    remainder = number%10
    number = number//10
    print(remainder)
    new_number = new_number*10+remainder
    
print("numbers in original order")
while(new_number>0):
    remainder = new_number%10
    new_number = new_number//10
    print(remainder)

4.

character = input("Enter a character")
print("UniCode Code for given character is : ",ord(character))

5.

import turtle 
import math
skk = turtle.Turtle()
print(turtle.position())

for i in range(4):
    skk.pencolor("red")
    skk.forward(5)
    skk.right(90)
    skk.forward(5)
    skk.right(90)
    skk.forward(5)
    skk.right(90)
    skk.forward(5)
    skk.right(90)
    skk.pencolor("black")
    skk.forward(100)
    skk.right(90)

# for i in range()
skk.setpos(0,-50)
skk.right(90)
skk.pencolor("blue")
skk.circle(50)
skk.left(90)
skk.forward(100)
skk.pencolor("black")
skk.left(90)
skk.forward(50)
skk.left(135)
j = 0
while (j<35):
  if(j%2 == 0):
    skk.penup()
    skk.forward(4)
  else :
    skk.pendown()
    skk.forward(4)
  j = j+1

turtle.done()

6.

import turtle 
import math

skk = turtle.Turtle()

for i in range(4):
    skk.forward(200)
    skk.right(90)

skk.penup()
skk.forward(5)
skk.right(90)
skk.forward(5)
skk.left(90)
skk.pendown()
skk.pencolor("blue")
for i in range(4):
  skk.forward(80)
  skk.right(90)

skk.penup()
skk.forward(110)
skk.pendown()
skk.pencolor("green")
for i in range(4):
  skk.forward(80)
  skk.right(90)

skk.penup()
skk.right(90)
skk.forward(110)
skk.pendown()
skk.pencolor("yellow")
skk.left(90)
for i in range(4):
  skk.forward(80)
  skk.right(90)

skk.penup()
skk.right(180)
skk.forward(110)
skk.pendown()
skk.pencolor("red")
skk.left(180)
for i in range(4):
  skk.forward(80)
  skk.right(90)

skk.penup()
skk.forward(15)
skk.right(90)
skk.forward(60)
skk.pendown()
skk.fillcolor('red') 
skk.begin_fill()
skk.left(90)
skk.forward(50)
skk.left(120)
skk.forward(50)
skk.left(120)
skk.forward(50)
skk.end_fill()

skk.penup()
skk.left(120)
skk.forward(105)
skk.pendown()
skk.pencolor('yellow')
skk.fillcolor('yellow') 
skk.begin_fill()
skk.forward(60)
skk.left(90)
skk.forward(40)
skk.left(90)
skk.forward(60)
skk.left(90)
skk.forward(40)
skk.left(180)
skk.end_fill()

skk.penup()
skk.forward(130)
skk.right(90)
skk.forward(5)
skk.pendown()
skk.pencolor('green')
skk.fillcolor('green') 
skk.begin_fill()
skk.right(90)
skk.circle(25)
skk.right(90)
skk.end_fill()

skk.penup()
skk.forward(55)
skk.left(90)
skk.forward(30)
skk.pendown()
skk.pencolor('blue')
skk.right(90)
skk.fillcolor('blue') 
skk.begin_fill()
for i in range(4):
    skk.forward(60)
    skk.right(90)
skk.end_fill()

Just a request , Please don`t so much questions at one go , It`s difficult to answer all of them in just 2-3 hrs span . Better break half quantity and ask , it would help us also .
Hope the answers help, If any issue do comment !!

Add a comment
Know the answer?
Add Answer to:
USING PYTHON LANGUAGE. QUESTION I: Write a program that displays the following table: a a^2 a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coin

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.