0% found this document useful (0 votes)
4 views

Fifth Assignment

The document contains a series of Python programming tasks, including finding the sum of dictionary values, classifying triangles based on side lengths, printing a specific number pattern, modifying strings based on conditions, identifying the longest word from user input, clearing list values in a dictionary, summing two integral numbers in string form, evaluating a piecewise function, rearranging letters in a word, and validating user credentials. Each task is described with specific requirements and expected outcomes. The tasks cover various fundamental programming concepts and operations in Python.

Uploaded by

v.manohar792
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Fifth Assignment

The document contains a series of Python programming tasks, including finding the sum of dictionary values, classifying triangles based on side lengths, printing a specific number pattern, modifying strings based on conditions, identifying the longest word from user input, clearing list values in a dictionary, summing two integral numbers in string form, evaluating a piecewise function, rearranging letters in a word, and validating user credentials. Each task is described with specific requirements and expected outcomes. The tasks cover various fundamental programming concepts and operations in Python.

Uploaded by

v.manohar792
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1)Write a Python Program to find the sum of values in the dictionary?

Dictionary is a = {'Codegnan': 250,'Manohar':300,'Python':250,'Monday':200}

2)Write a Python program to check a triangle is equilateral, isosceles or scalene by accepting 3 sides as
input from the user?

An equilateral triangle is a triangle in which all three sides are equal.

A scalene triangle is a triangle that has three unequal sides.

An isosceles triangle is a triangle with (at least) two equal sides.

3)Write a Python Program to print the following pattern?

22

333

4444

55555

666666

7777777

88888888

999999999

4)Write a Python program to add 'ing' at the end of a given string (length should be at least 3). If the
given string already ends with 'ing' then add 'ly' instead. If the length of the given string is less than 3,
leave it unchanged.

5)Write a Python program that takes multiple words as input from user (store in list) and return the
longest word and the length of the longest one?
6)Write a Python program to remove the list values in the given dictionary?

your dictionary is :

a = {'Monday': [10, 20, 30], 'Tuesday': [20, 30, 40], 'Wednesday': [12,15,16,28],'Thursday':[52,12,36,6],

'Friday': [15,16,28,9,25],'Saturday':[15,25,35,45]}

Output is: {'Monday': [], 'Tuesday': [], 'Wednesday': [], 'Thursday': [], 'Friday': [], 'Saturday': []}

7)Define a function that can receive two integral numbers in string form and compute their sum and
then print it in console

8)Evaluate the conditions for the given below logic:

f(x) = { 3x-1 (x>1)

x+2 (-1<=x<=1)

5x+3 (x<=-1) }

9)Your input string is a = "silent" output string should be as b = "listen" ?

10)Accept Username and password as strings from user and validate username with password, such as if
username and password are matching login success

You might also like