# Category Archives: Python

## Programming Problem Solve with Python:

Problem: Only Positive Numbers

positiveFunc([-5,3,-1,101])

## Pyhton as a new beginning

Same output but the code is in diffrent approach.

## Python Course Started, Alhamdulillah

The Python Mega Course: Build 10 Real World Applications

Bismillahir Rahmanir Rahim. I am exploring this course for growing interest in my career:

Summary: Integers, Floats, Lists, Dictionaries, Tuples, dir, help

In this section you learned that:

• Integers are for representing whole numbers:
1. rank = 10
2. eggs = 12
3. people = 3
• Floats represent continuous values:
1. temperature = 10.2
2. rainfall = 5.98
3. elevation = 1031.88
• Strings represent any text:
1. message = “Welcome to our online shop!”
2. name = “John”
3. serial = “R001991981SW”
• Lists represent arrays of values that may change during the course of the program:
1. members = [“Sim Soony”, “Marry Roundknee”, “Jack Corridor”]
2. pixel_values = [252, 251, 251, 253, 250, 248, 247]
• Dictionaries represent pairs of keys and values:
1. phone_numbers = {“John Smith”: “+37682929928”, “Marry Simpons”: “+423998200919”}
2. volcano_elevations = {“Glacier Peak”: 3213.9, “Rainer”: 4392.1}
• Keys of a dictionary can be extracted with:
1. phone_numbers.keys()
• Values of a dictionary can be extracted with:
1. phone_numbers.values()
• Tuples represent arrays of values that are not to be changed during the course of the program:
1. vowels = (‘a’, ‘e’, ‘i’, ‘o’, ‘u’)
2. one_digits = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
• To find out what attributes a type has:
1. dir(str)
2. dir(list)
3. dir(dict)
• To find out what Python builtin functions there are:
1. dir(__builtins__)
• Documentation for a Python command can be found with:
1. help(str)
2. help(str.replace)
3. help(dict.values)

## Mission Machine Learning

Pagerank Algorithm Eigenvalue

Square Matrices

Geometric Interpretation

Eigenvalue:

## Python String formatting

Playing With String in Function of Python

With First letter capital:

Converting string to int:

For Python 1 and 2

## Python Function Calling

• Check if a value is of a certain type with:
1. isinstance(“abc”, str)
2. isinstance([1, 2, 3], list)

or

1. type(“abc”) == str
2. type([1, 2, 3]) == lst

## Working with lists and append

Question:Append the first item of weekend to workdays

## Dictionary in Python

Assign a dictionary variable day_temperatures.The dictionary should contain three keys ‘morning’,’noon’and evening and each key should containa tuple as value. each tuple should contain three floats.

Code:

Student.java

StudentTest.java