Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please use python and explain the code please Lab Part 1. Using Range() and ASCII A. Use range() to write a Python program, liftoff(n), that

image text in transcribed
image text in transcribed
please use python and explain the code please
Lab Part 1. Using Range() and ASCII A. Use range() to write a Python program, liftoff(n), that counts down from a positive integer n and then prints "Lift Off!" B. Use range() and chr() to write a Python program, alphabet(), that prints the uppercase and lowercase letters in the American alphabet, in two columns, showing the letter, its ASCII code, then the lowercase version and its ASCII code, like this: A 65 a 97 B 66 b 98 And so on. C. Write a Python program to generate your own ASCII chart. It should show printable versions of those characters that are printable and Ix notation for those that are not. Include a column for decimal representation, hexadecimal notation, and binary. Optional - find a way to show commonly used formats for non-printable characters such as NUL for chr(0), as well as special control characters such as CR and LF. (Hint: if you are familiar with Python's dictionary construct, that might be helpful.) Lab Part 2. Bitwise Operations Write a Python program to demonstrate each of its 6 bitwise operations: 02 03 XOR (1) 1 04 05 06 Complement Lah SMR e ) SA Your program should read in integers typed by the user, print their binary representations, and then print the results of each operation in both binary and decimal. Provide a way for the user to indicate which of the 6 operations to use as well as a way for the user to indicate that they are done using the program. Lab Part 3. Hashing A. Use the hashlib library and the encrypt_string function from the lecture notes to create a "hash signature" for a word represented as a string of ASCII characters. B. Use your solution to 3A with the map function to create a list of hash signatures representing a sentence, which is represented as a list of words. C. Try making small (1 or 2 character) changes in your words to see how much the hash has changed. Please get in the habit of normally including the following code at the bottom of any file that includes a main() function. Files should start with any import statements, then function definitions, and then your definition of main(), where applicable. There usually should not be any directly executable code mixed in, so that your function definitions can be imported into other projects without side effects," or run as a standalone if there is a useful main() function provided. if _name__ == "_main_": main()

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions

Question

find all matrices A (a) A = 13 (b) A + A = 213

Answered: 1 week ago

Question

=+ How would you advise those problems be resolved?

Answered: 1 week ago