100% Guaranteed Results


YWPython – Homework #2 Solved
$ 20.99
Category:

Description

5/5 – (1 vote)

1) Create a list with your identification information.
For example my lists length will be 4. If I will reach the value of the list on index 0, list[0] I will receive the “Alex”. Run with for loop over the list and print its content.
2) Create a program that receives two lists of the same length with integers as values, if the lists are not of the same length the program must return the relevant error. The program will create a new list that will contain the largest value between the two lists at a specific index. Example:
Input of two lists: lst1 = [1,2,3,4,5] lst2 = [5,4,3,2,1] output:
[5, 4, 3, 4, 5]
In the end of the program you must print the new list.

3) Create a python program that will count the number of appearances of odd and even values in a list. In case that the program encounters a string use break statement and return a print that says, “It’s a string!!!” and nullify the values of odd and even numbers counters.
Example:
• list = [1, 2, 3, 4, 5, 6, 7, 8, 9] Expected Output :
Number of even numbers : 5
Number of odd numbers : 4
• list = [1, 2, 3, 4, “Oops”, 6, 7, 8, 9] Expected Output :
“It’s a string!!!”

4) Build a function that will receive a list with integer values as its input. The function will calculate the sum of the integers in the list and will return the sum result.

5) Build a function that will receive a list with integer values as its input. The function will multiply all values in the list and return the result.

6) Build a function that will receive a list with integer values as its input. The function will find the minimal value in the list and return this value.
7) Build a Python function that accepts a string and calculate the number of upper case letters and lower case letters. Sample String: ‘Alex Kuznetsov’ Expected Output:
No. of Upper case characters: 2
No. of Lower case Characters: 11

Challenges:

8) Build a Python function that takes a list and returns a new list with unique elements of the first list.
Example:
• Input list : [1,2,3,3,3,3,4,5]
• Output list : [1, 2, 3, 4, 5]

9) Write a Python program to construct the following pattern, using a nested loop.

1
12
123
1234
12345
123456
1234567
12345678

10) Write a Python program to print the following patterns:

****
*
*
***
* *
****

Reviews

There are no reviews yet.

Be the first to review “YWPython – Homework #2 Solved”

Your email address will not be published. Required fields are marked *

Related products