Write easy programming in python

Completed Posted Feb 9, 2015 Paid on delivery
Completed

Instructions:

This assignment is due by 11:59 pm on Monday (02/09/2015).

You should submit ONLY one doc (or docx or pdf) file named [url removed, login to view] (or .docx or .pdf). Any other file format (like .py, .zip, .rar, etc.) is not allowed. This file should contain your python code for the program(s) and the screen shot(s) of your program's sample runs (with output). Make sure to put your python code correctly in this file (with correct indentation). If you have any text for the grader to read before grading, you can include it at the top of this file.

You must use Python 3.x to implement these programs.

Your grade will be based on functionality (does the program do what it is suppose to do) and understandability (are the literals meaningful and is the code modular and well documented with appropriate comments).

____________________________________________________________________________________________________

Part - I (5 points)

This part of the assignment contains multiple subparts. Make sure to complete all subparts to get full credit. You must use (nested) loops to program the solution to problems mentioned below. You are not allowed to use print statements that print multiple numbers at the same time. For example: to print numbers from 0 to 9 in the same line, you are not allowed to use:

print(0,1,2,3,4,5,6,7,8,9) or print(“0 1 2 3 4 5 6 7 8 9”)

Instead you should use:

for i in range(10):

print(i, end = “ “)

--------------------------------------

1) Part a: Write code that will print the following:

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9

HINT: You need to use two for loops (one nested inside the other). First, create a loop that prints the first line (DO NOT PRINT USING print("0 1 2 3 4 5 6 7 8 9")). Then enclose it in another loop that repeats the line 10 times. Use either i or j variables for what the program prints. This problem and the next one helps reinforce what those index variables are doing.

Part b: Adjust the prior program to print:

0 0 0 0 0 0 0 0 0 0

1 1 1 1 1 1 1 1 1 1

2 2 2 2 2 2 2 2 2 2

3 3 3 3 3 3 3 3 3 3

4 4 4 4 4 4 4 4 4 4

5 5 5 5 5 5 5 5 5 5

6 6 6 6 6 6 6 6 6 6

7 7 7 7 7 7 7 7 7 7

8 8 8 8 8 8 8 8 8 8

9 9 9 9 9 9 9 9 9 9

2) Write code that will print the following:

0

0 1

0 1 2

0 1 2 3

0 1 2 3 4

0 1 2 3 4 5

0 1 2 3 4 5 6

0 1 2 3 4 5 6 7

0 1 2 3 4 5 6 7 8

0 1 2 3 4 5 6 7 8 9

HINT: This is same as problem (1), but the inside loop no longer loops a fixed number of times. Don't use range(10), but adjust that range amount.

Extra Credit (2 points):

Write a Python program that will print the following:

10

11 12

13 14 15

16 17 18 19

----

For Encryption: You should ask the user for any regular message and a key and output the corresponding encrypted message.

Sample run:

Enter a regular message to encode:

Attack at dawn!

Enter a key value (between 0 and 100) for encoding:

88

The encoded message is:

:mmZ\dxZmx]Zpgy

----

For Decryption: You should ask the user for an encrypted message and output 100 well-formatted, decrypted messages (using keys between 1 and 100) along with the corresponding key value.

Sample run (the gibberish messages below are not accurate):

Enter an encrypted message to decode:

:mmZ\dxZmx]Zpgy

The following are the decoded messages for keys 1 to 100:

Key: 1 –> Decoded Message: whfuihwuiidh89

Key: 2 –> Decoded Message: 9ehkaOY3ewine

...

Key: 87 –> Decoded Message: Buubdl!bu!ebxo”

Key: 88 –> Decoded Message: Attack at dawn!

...

Key: 100 –> Decoded Message: on3dwp389/wi8

C Programming Java Python

Project ID: #7115478

About the project

1 proposal Remote project Active Feb 9, 2015

Awarded to:

shankar12243

I can implement your project in a span of 20 minutes. Just send me a conformation message and I will start

₹277 INR / hour
(0 Reviews)
0.0

1 freelancer is bidding on average ₹277 for this job

ithuang2014

A proposal has not yet been provided

₹263 INR / hour
(8 Reviews)
2.4