It is very hard to master any of programming language and many students have troubles with it. That is why we have decided to render assistance for those who have difficulties with Python. Python problems are very common among students. They are tired of constant Python questions and try to find the Python answers. Ask your questions here and be sure to get the 100% truthful answers. The only thing you will have to do – is to send the request with Python questions and to have no hesitation that all your Python questions will be satisfied.

rt 1

Write a function called has_duplicates that takes a string parameter and returns True if the string has any repeated characters. Otherwise, it should return False.

Implement has_duplicates by creating a histogram using the histogram function above. Do not use any of the implementations of has_duplicates that are given in your textbook. Instead, your implementation should use the counts in the histogram to decide if there are any duplicates.

Write a loop over the strings in the provided test_dups list. Print each string in the list and whether or not it has any duplicates based on the return value of has_duplicates for that string. For example, the output for "aaa" and "abc" would be the following.

aaa has duplicates

abc has no duplicates

Print a line like one of the above for each of the strings in test_dups

Write a function called has_duplicates that takes a string parameter and returns True if the string has any repeated characters. Otherwise, it should return False.

Implement has_duplicates by creating a histogram using the histogram function above. Do not use any of the implementations of has_duplicates that are given in your textbook. Instead, your implementation should use the counts in the histogram to decide if there are any duplicates.

Write a loop over the strings in the provided test_dups list. Print each string in the list and whether or not it has any duplicates based on the return value of has_duplicates for that string. For example, the output for "aaa" and "abc" would be the following.

aaa has duplicates

abc has no duplicates

Print a line like one of the above for each of the strings in test_dups

Python

Write a program in python that displays your name inside a box on the screen. Do your best to approximate lines with characters such as | - +.

Write a function named test_sqrt that prints a table like the following using a while loop, where "diff" is the absolute value of the difference between my_sqrt(a) and math.sqrt(a).

a = 1 | my_sqrt(a) = 1 | math.sqrt(a) = 1.0 | diff = 0.0

a = 2 | my_sqrt(a) = 1.41421356237 | math.sqrt(a) = 1.41421356237 | diff = 2.22044604925e-16

a = 3 | my_sqrt(a) = 1.73205080757 | math.sqrt(a) = 1.73205080757 | diff = 0.0

a = 4 | my_sqrt(a) = 2.0 | math.sqrt(a) = 2.0 | diff = 0.0

a = 5 | my_sqrt(a) = 2.2360679775 | math.sqrt(a) = 2.2360679775 | diff = 0.0

a = 6 | my_sqrt(a) = 2.44948974278 | math.sqrt(a) = 2.44948974278 | diff = 0.0

a = 7 | my_sqrt(a) = 2.64575131106 | math.sqrt(a) = 2.64575131106 | diff = 0.0

a = 8 | my_sqrt(a) = 2.82842712475 | math.sqrt(a) = 2.82842712475 | diff = 4.4408920985e-16

a = 9 | my_sqrt(a) = 3.0 | math.sqrt(a) = 3.0 | diff = 0.0

a = 1 | my_sqrt(a) = 1 | math.sqrt(a) = 1.0 | diff = 0.0

a = 2 | my_sqrt(a) = 1.41421356237 | math.sqrt(a) = 1.41421356237 | diff = 2.22044604925e-16

a = 3 | my_sqrt(a) = 1.73205080757 | math.sqrt(a) = 1.73205080757 | diff = 0.0

a = 4 | my_sqrt(a) = 2.0 | math.sqrt(a) = 2.0 | diff = 0.0

a = 5 | my_sqrt(a) = 2.2360679775 | math.sqrt(a) = 2.2360679775 | diff = 0.0

a = 6 | my_sqrt(a) = 2.44948974278 | math.sqrt(a) = 2.44948974278 | diff = 0.0

a = 7 | my_sqrt(a) = 2.64575131106 | math.sqrt(a) = 2.64575131106 | diff = 0.0

a = 8 | my_sqrt(a) = 2.82842712475 | math.sqrt(a) = 2.82842712475 | diff = 4.4408920985e-16

a = 9 | my_sqrt(a) = 3.0 | math.sqrt(a) = 3.0 | diff = 0.0

Python

In this assignment, you will use all of the graphics commands you have learned to create an animated scene. Your program should have a clear theme and tell a story. You may pick any school-appropriate theme that you like.

The program must include a minimum of:

5 circles

5 polygons

5 line commands

2 for loops

1 global variable

You may wish to use the standard boilerplate code for simplegui graphics:

import simplegui

def draw_handler(canvas):

frame = simplegui.create_frame('Testing', 600, 600)

frame.set_canvas_background("Black")

frame.set_draw_handler(draw_handler)

frame.start()

The program must include a minimum of:

5 circles

5 polygons

5 line commands

2 for loops

1 global variable

You may wish to use the standard boilerplate code for simplegui graphics:

import simplegui

def draw_handler(canvas):

frame = simplegui.create_frame('Testing', 600, 600)

frame.set_canvas_background("Black")

frame.set_draw_handler(draw_handler)

frame.start()

How to make a script file and a plain text output file (.txt) that contains the test output?

Construct a dictionary for storing Student information. The dictionary should have

‘studentId’ as key and ‘studentName’ , ‘studentRollNo’, ‘studentAge’, and the last element

will be a list containing marks of students in 5 subjects. Your task is to populate this

dictionary with at least 10 entries and display all the information about the students with

Highest and lowest marks. Also calculate the average marks scored by all the students and

display the information of students scoring above average marks. At last, sort the dictionary

by the ‘studentName’ and display the result.

‘studentId’ as key and ‘studentName’ , ‘studentRollNo’, ‘studentAge’, and the last element

will be a list containing marks of students in 5 subjects. Your task is to populate this

dictionary with at least 10 entries and display all the information about the students with

Highest and lowest marks. Also calculate the average marks scored by all the students and

display the information of students scoring above average marks. At last, sort the dictionary

by the ‘studentName’ and display the result.

Give at least three examples that show different features of string slices. Describe the feature illustrated by each example. Invent your own examples. Do not copy them for the textbook or any other source.

. Consider the loop from Section 8.3 of your textbook.

prefixes = 'JKLMNOPQ'

suffix = 'ack'

for letter in prefixes:

print(letter + suffix)

Put this code into a Python script and run it. Notice that it prints the names "Oack" and "Qack".

Modify the program so that it prints "Ouack" and "Quack" but leaves the other names the same.

Include the modified Python code and the output in your submission.

prefixes = 'JKLMNOPQ'

suffix = 'ack'

for letter in prefixes:

print(letter + suffix)

Put this code into a Python script and run it. Notice that it prints the names "Oack" and "Qack".

Modify the program so that it prints "Ouack" and "Quack" but leaves the other names the same.

Include the modified Python code and the output in your submission.

Write a function named test_sqrt that prints a table like the following using a while loop, where "diff" is the absolute value of the difference between my_sqrt(a) and math.sqrt(a).

a = 1 | my_sqrt(a) = 1 | math.sqrt(a) = 1.0 | diff = 0.0

a = 2 | my_sqrt(a) = 1.41421356237 | math.sqrt(a) = 1.41421356237 | diff = 2.22044604925e-16

a = 3 | my_sqrt(a) = 1.73205080757 | math.sqrt(a) = 1.73205080757 | diff = 0.0

a = 4 | my_sqrt(a) = 2.0 | math.sqrt(a) = 2.0 | diff = 0.0

a = 5 | my_sqrt(a) = 2.2360679775 | math.sqrt(a) = 2.2360679775 | diff = 0.0

a = 6 | my_sqrt(a) = 2.44948974278 | math.sqrt(a) = 2.44948974278 | diff = 0.0

a = 7 | my_sqrt(a) = 2.64575131106 | math.sqrt(a) = 2.64575131106 | diff = 0.0

a = 8 | my_sqrt(a) = 2.82842712475 | math.sqrt(a) = 2.82842712475 | diff = 4.4408920985e-16

a = 9 | my_sqrt(a) = 3.0 | math.sqrt(a) = 3.0 | diff = 0.0

Modify your program so that it outputs lines for a values from 1 to 25 instead of just 1 to 9.

a = 1 | my_sqrt(a) = 1 | math.sqrt(a) = 1.0 | diff = 0.0

a = 2 | my_sqrt(a) = 1.41421356237 | math.sqrt(a) = 1.41421356237 | diff = 2.22044604925e-16

a = 3 | my_sqrt(a) = 1.73205080757 | math.sqrt(a) = 1.73205080757 | diff = 0.0

a = 4 | my_sqrt(a) = 2.0 | math.sqrt(a) = 2.0 | diff = 0.0

a = 5 | my_sqrt(a) = 2.2360679775 | math.sqrt(a) = 2.2360679775 | diff = 0.0

a = 6 | my_sqrt(a) = 2.44948974278 | math.sqrt(a) = 2.44948974278 | diff = 0.0

a = 7 | my_sqrt(a) = 2.64575131106 | math.sqrt(a) = 2.64575131106 | diff = 0.0

a = 8 | my_sqrt(a) = 2.82842712475 | math.sqrt(a) = 2.82842712475 | diff = 4.4408920985e-16

a = 9 | my_sqrt(a) = 3.0 | math.sqrt(a) = 3.0 | diff = 0.0

Modify your program so that it outputs lines for a values from 1 to 25 instead of just 1 to 9.