Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Calculate the sum of 10.8, 12.2 and 0.2, store it in the variable total, then display total's value. 2. Evaluate the expressions 4**3**2,

  1. 1. Calculate the sum of 10.8, 12.2 and 0.2, store it in the variable total, then display total's value.
  2.  
  3. 2. Evaluate the expressions 4**3**2, (4**3)**2 and 4**(3**2). Are any of the parentheses redundant?
  4.  
  5. 3. Use float to convert '6.2' (a string) to a floating-point value. Multiply the value by 3.3 and show the answers
  6.  
  7. 4.For the value 47, 95, 88, 73 and 84 calculate the minimum and maximum.
  8.  
  9. 5. Write a Python program to calculate a dog's age in a dog's years. Note: For the first two years, a dog year is equal to 10.5 human years. After that, each dog year equals 4 human years. Expected Output:
  10. Input a dog's age in human years: 15
    The dog's age in dog's years is 73
  11.  
  12. 6.Write a Python program to find the median of three values. Expected Output:
  13. Input first number: 15
    Input second number: 26
    Input third number: 29
    The median is 26.0
  14.  
  15. 7.Write a Pandas program to select the rows the score is between 15 and 20 (inclusive). Sample Python dictionary data and list labels:
    exam_data = {'name': ['Anastasia', 'Dima', 'Katherine', 'James', 'Emily', 'Michael', 'Matthew', 'Laura', 'Kevin', 'Jonas'], 'score': [12.5, 9, 16.5, np.nan, 9, 20, 14.5, np.nan, 8, 19],
    'attempts': [1, 3, 2, 3, 2, 3, 1, 1, 2, 1],
    'qualify': ['yes', 'no', 'yes', 'no', 'no', 'yes', 'yes', 'no', 'no', 'yes']}
    labels = ['a', 'b', 'c', 'd', 'e', 'f', 'g', labels = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
    Expected Output:
    Rows where score between 15 and 20 (inclusive):
       attempts   name   qualify   score
    c      2     Katherine yes      16.5
    f      3     Michael    yes       20.0
    j      1     Jonas       yes       19.0
  16.  
  17. 8.Write a Pandas program to calculate the sum of the examination attempts by the students.
  18. Sample DataFrame: exam_data = {'name': ['Anastasia', 'Dima', 'Katherine', 'James', 'Emily', 'Michael', 'Matthew', 'Laura', 'Kevin', 'Jonas'], 'score': [12.5, 9, 16.5, np.nan, 9, 20, 14.5, np.nan, 8, 19], 'attempts': [1, 3, 2, 3, 2, 3, 1, 1, 2, 1], 'qualify': ['yes', 'no', 'yes', 'no', 'no', 'yes', 'yes', 'no', 'no', 'yes']} labels = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
  19.  
  20. 9.Write a Pandas program to sort the data frame first by 'name' in descending order, then by 'score' in ascending order.
  21. Sample DataFrame: exam_data = {'name': ['Anastasia', 'Dima', 'Katherine', 'James', 'Emily', 'Michael', 'Matthew', 'Laura', 'Kevin', 'Jonas'], 'score': [12.5, 9, 16.5, np.nan, 9, 20, 14.5, np.nan, 8, 19], 'attempts': [1, 3, 2, 3, 2, 3, 1, 1, 2, 1], 'qualify': ['yes', 'no', 'yes', 'no', 'no', 'yes', 'yes', 'no', 'no', 'yes']} labels = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'] Values for each column will be: name : 'Suresh', score: 15.5, attempts: 1, qualify: 'yes', label: 'k'
  22.  
  23. 10.Write a Python program to create the multiplication table (from 1 to 10) of a number. Expected Output:
     
  24. Input a number: 6
    6 x 1 = 6
    6 x 2 = 12
    6 x 3 = 18
    6 x 4 = 24
    6 x 5 = 30
    6 x 6 = 36
    6 x 7 = 42
    6 x 8 = 48
    6 x 9 = 54
    6 x 10 = 60
  25.  

Step by Step Solution

3.27 Rating (147 Votes )

There are 3 Steps involved in it

Step: 1

Below are the python programs 1 total 108 122 02 print... 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

Microsoft Visual C# An Introduction to Object-Oriented Programming

Authors: Joyce Farrell

7th edition

978-1337102100

More Books

Students also viewed these Programming questions

Question

=+LO 1-1 Define digital marketing.

Answered: 1 week ago