## Wednesday, September 11, 2019

#### Exercise 1

Write an algorithm in python which exchanges two integers m and n entered on the keyboard and which displays the values of the numbers before and after the exchange operation.

#### Solution

# Ask user to type values of n and m
n = int(input("Type value of the integer n : "))
m = int(input("Type value of the integer m : "))

# use an auxiliary variable in order to be able to exchange the values of m and n
print("display m and n before exchange values : " , " n = ", n , "m = ", m)
v = 0
v = n
n = m
m = v
print("display m and n after exchange values : " , " n = ", n , "m = ", m)

Younes Derfoufi
my-courses.net

## Friday, September 6, 2019

Exercise 35
Write a program in Python that allows you to transform a given url address into a link.

#### Solution

# Ask user to type an url
url = input("Type an url :")
text_lien = input("Type a text of link")
# convert the url text to a link
url = " " + text_lien + ""
print("The text with link is : ", url)
"""
Example
Type an url :https://www.my-courses.net
Type a text of link My Courses
The text with link is :  < a href="https://www.my-courses.net/" > My Courses< / a >
"""

Younes Derfoufi

#### Exercise 34

Given the list of student notes: notes = [12, 04, 14, 11, 18, 13, 07, 10, 05, 09, 15, 08, 14, 16]. Write a Python program that allows you to extract from this list another list that contains only the notes above the average ( notes > = 10 ).

#### Solution

notes = [12, 4, 14, 11, 18, 13, 7, 10, 5, 9, 15, 8, 14, 16]

# define list that will contains the notes above the averge
above = []
for x in notes:
if( x >= 10):
above.append(x)
print("The list that contains only the notes above the average is : ", above)

Younes Derfoufi

#### Exercise 33

Write a program in Python that asks the user to enter a string and display the characters of even index. Example for the string s = "Python", the program returns "Pto".

#### Solution

# Ask user to type a string s
s = input("type a string s :")

# define and initialize the string that will contain the characters of even index
even = ""

# search through the string s all characters of even index
for i in range(0,len(s)):
if(i%2 == 0):
even = even + s[i]

print("The extracted string that contains the characters of even index is :", even)

my-courses.net
Unveiled a little less than a year ago, the Microsoft cloud gaming service will be tested in October in 5G in South Korea thanks to an exclusive partnership with the operator SK Telecom.
The cloud gaming offer announced in October 2018 by Microsoft is taking shape. The US company announced on September 4, 2019 the launch of its Project xCloud in South Korea. Microsoft is partnering with South Korean operator SK Telecom for the occasion through an exclusive partnership. The main innovative feature of this agreement is that the service will be available via a 5G connection. The two companies, which spoke at a press conference in Seoul, "will cooperate to unveil the xCloud project in October".

## Thursday, September 5, 2019

#### Exercise 32

Write a program in Python that returns all the lists obtained by swapping the terms of a given list.

#### Solution

"""import itertools module :
This module implements many iterator bricks inspired by APL, Haskell and SML constructs.
"""
import itertools
# Example of use
l = [1,2,3,4,5]
permutations = itertools.permutations(l)
L = list(permutations)
print("All lists obtained by swapping the terms of list l :  " , L)

Younes Derfoufi

#### Exercise 31

Write a Python program that retrieves the list of even integers and the list of odd integers from a list of numbers.

#### Solution

# 1) define the function that retrieves the list of enven integers
def evenIntegers(l):
# define the list of even integer
even = []

# Browse the evens integers in the list l
for n in l:
if(n%2 == 0):
even.append(n)
return even

# 1) define the function that retrieves the list of odd integers
def oddIntegers(l):
# define the list of even integer
odd = []

# Browse the odd integers  in the list l
for n in l:
if(n%2 != 0):
odd.append(n)
return odd

# Example
l = [4 , 3 , 5 , 18 , 13 , 23 , 48]
print("The list of evens integers is : ", evenIntegers(l))
print("The list of odd integers is : ", oddIntegers(l))

Younes Derfoufi
A mechanism called "Push Pages" would create a unique identifier for each user. It would then be shared with the Authorized Buyers advertising auction customers.
Brave just planted a few more fangs in Google's calves. In September 2018, its legal director Johnny Ryan and two other people filed a complaint against the computer giant for non-compliance with the RGPD. They felt that its online auction system for advertising placement (DoubleClick / Authorized Buyers) has the effect of collecting personal data from users and dispersing them to client advertising agencies, without the user being informed. .

## Wednesday, September 4, 2019

#### Exercise 30

Write a function in Python that allows to compare two lists and to tell us if these two lists have a common value or not.

#### Solution

# define a function that compare two lists l1 and l2
def commonElements(l1,l2):
counter = 0
# try if there exists a common element and then increment the counter
for x in l1:
for y in l2:
if(x == y):
counter = counter + 1
if counter >=1:
return True
else:
return False

# Example
l1 = [3, 9, 4, 7]
l2 = [1, 14, 3, 7, 5]
print(commonElements(l1,l2))

Younes Derfoufi

#### Exercise 29

Write a Python program that removes duplicate items from a list.

### First method

# -*- coding: utf-8 -*-
# define a function that remove duplicate element in list
def removeDuplicate(l):
# define and initialize list with no duplicate element
unique = []
# building a list with no duplicate element
for x in l:
if x not in unique:
unique.append(x)
return unique

# Example
l = [2, 7, 13, 2, 17, 13, 2, 7, 13]
print(removeDuplicate(l))

### Second method

# -*- coding: utf-8 -*-
# define a function that remove duplicate element in list
def removeDuplicate(l):
# convert the list l to a set
SET = set(l)
# reconvert the set SET to a list
L   = list(SET)
return L

# Example
l = [2, 7,7, 13, 2, 17, 17, 13, 15, 15, 2, 7, 13]
print(removeDuplicate(l))

Younes Derfoufi
Without being the update of the decade, Android 10 brings a few new welcome to our smartphones. Pixels are entitled to it today.
It is the regime that Google launches the new version of Android. For the first time in 10 years, the company is renouncing the names of sweets in favor of more conventional version numbers. So do not call it Android Q ... but Android 10. This update is already available on smartphones Pixel and will arrive little by little at other manufacturers. We know for example that Essential, Nokia and OnePlus should be among the first served.

## Tuesday, September 3, 2019

#### Exercise 28

Write a Python program that tests whether a list is empty or not. Same question for a string of characters.

### First method

Try if a list is empty
# define a list L
L = list()

# try if the list L is empty
if L == []:
print("The list  L is empty")
else:
print("The list L is not  empty")
Try if a string is empty
# define a string s
s=""

# try if the string s is empty
if s == "":
print("The string s  is empty")
else:
print("The list s is not  empty")

### Second Method

Try if a list is empty
# define a list L
L = list()

# try if the list L is empty by using the len() function
if len(L) == 0:
print("The list  L is empty")
else:
print("The list  L is not  empty")
Try if a string is empty
# define a string s
s=""

# try if the string s is empty by using the len() function
if len(s) == 0:
print("The string s  is empty")
else:
print("The list s is not  empty")

Younes Derfoufi

#### Exercise 27

Write a program in Python as a function that calculates the sum of elements in a list of numbers. And another that multiplies all the elements of a list of numbers.

#### Solution

# Function that calculate the product of list elements
def mult(l):
m = 1
# run through the list elements
for x in l:
m = m*x
return m
print(mult([2,5,3]))

# Function that calculate the sum of list elements
def sum(l):
s = 0
# run through the list elements
for x in l:
s = s + x
return s
print(sum([2,5,3]))

Younes Derfoufi

#### Exercise 23

Write a program in Python language that asks the user to enter the name of a file and return the extension. Example if the user enters coursPython.pdf the program returns the message "The file extension is .pdf".

#### Solution

# ask user to enter a file name with extension
myFile = input("Enter the file name with extension: ")

# convert the file name to list by choosing the '.' caracter as separator
list = myFile.split(".")

# find the extension of file name
ext = list[-1]
print ("The file extension  is : " + ext)

Younes Derfoufi
Verbatim secures its new portable hard drive with a fingerprint reader
The FingerPrint Secure drive has hardware encryption and fingerprint access.
Known a few years ago for its USB sticks, as well as its blank CDs and DVDs, the manufacturer Verbatim is back on the storage market by presenting to the IFA an original portable hard drive. The FingerPrint Secure is distinguished by a hardware encryption (AES 256 bits), but especially by its built-in fingerprint reader.
would work on a smarter way to display the thumbs-up count collected by a publication, to limit ego wars and deletions of publications.
Bye bye thumb up. Facebook is it about to revolutionize its mode of operation? It could be good. The behemoth of social networks is currently leading tests to show a limited number of "Likes" on a post published in the News Feed column. "Thumbs up" that would be mainly attributed by known contacts of the person browsing the thread of his publications.

This seventy-ninth version of the Mozilla Web browser gives Mac users a head start, a little more trouble with Flash, and smarter PC tab browsing.
Firefox 69 will be deployed tomorrow, Wednesday, September 4th. And if you are in a hurry to get your hands on it, Mozilla already offers a preloading of the installation file on its FTP. Attention, the interface is ... foundry brute. The title of the links is quite clear but if you have any doubt, wait until the update program included in the browser offers the new version.

## Monday, September 2, 2019

#### Exercise 26

Write a program that asks the user to enter a text and return all words beginning with the letter a.

### First method

# Ask to type a string text
s = input("Type a string text : ")
# convert a string s to list
s = s.split()
# fetching all list element that beginning with the letter 'a'
for x in s:
if(x[0] == 'a'):
print("The word : ", x, " begin with the letter 'a'")

### Second method

Congress 2019 last March, the highly anticipated HoloLens 2 augmented reality headset from Microsoft will be available in September.
We already knew his price, 3500 dollars. According to Reuters, developers and companies interested in the Microsoft HoloLens 2 headset will be able to pay this amount as early as September to acquire it. Harry Shum, Executive Vice President of Microsoft, said at the World Conference on Artificial Intelligence (WAIC) in Shanghai, without specifying the day of the official release of the augmented reality headset . If the territories concerned have not been specified, France should be among the first served.

## Sunday, September 1, 2019

#### Exercise 25

Write a program that asks the user to enter a word and return the opposite. Example if the user enters the word python, the program returns nohtyp.

### First method

# Ask to type a string s
s = input("Type a string s : ")
# getting the reverse of the string s
s1 = s[::-1]

print("The reverse of the string : '",s,"' is : ", s1)

### Second method

# Ask to type a string s
s = input("Type a string s : ")
# initialize the reverse of the string s to empty string
rev = ""

# Building the string s in a reversed way
for x in s:
rev = x + rev
print("The reverse of the string : '",s,"' is : ", rev)

Younes Derfoufi

#### Exercise 24

A palindrome is a word whose order of letters remains the same whether it is read from left to right or from right to left. For example: 'laval', 'radar,' sos' ... are palindromes. Write a program in Python that asks the user to enter a word and return it if it is a palindrome or not?

#### Solution

# Ask to type a string s
s = input("Type a string s : ")

# getting the reverse of the string s
s1 = s[::-1]

# try if the typed strins s is a palindrome
if(s1 == s):
print("The string : '",s," ' is a palindrome")
else:
print("The string : '",s," ' is not a palindrome")

Younes Derfoufi

## Saturday, August 31, 2019

#### Exercise 22

Write a program in Python, which returns the first word of a given text. Example for the text: t = 'Python is a wonderful programming language', the program must return Python

#### Solution

# define a string s
s = "Learning Python in my-course.net"

# initialize the first word at empty string
first=""

# initialize a counter
i = 0
# search the first space in string
while (s[i] != " "):
first = first + s[i]
i = i + 1
print("The first word in the string s is : ", s[:i])

Younes Derfoufi

## Friday, August 30, 2019

Google Project Zero's security researchers have detected a highly sophisticated cyber-surveillance campaign that relied on trapped websites and 0-day flaws.
It is heavy. Google has just revealed the details of a particularly sophisticated espionage campaign, which allowed to hack softly iPhone tens of thousands of people. The hacking took place through a "small number of hacked websites" that targeted users in an undifferentiated way for "at least two years". "We estimate that these sites received thousands of visitors each week," said Ian Beer, a member of Google Project Zero and one of the best iPhone hackers, in a series of blog notes that details the technical aspects of these attacks.

#### Exercise 21

Write a program in Python language, which allows you to count the number of vowels in a given string. Example for the string s = 'anticonstitutionally' the program must return the following message: The string anconstitutionally has 9 vowels.

#### Solution

# program that determines the number of vowels in a string
# define vowels in string
vowels= {'a','e','y','u','i','o'}
# define string
s = "anticonstitutionally"
# getting the len of string
n = len(s)
# initialize number of vowels
number_vowels = 0
# browse all character of string s
for i in range(0,n):
if(s[i] in vowels):
number_vowels = number_vowels + 1
print("The number of vowels in string 's' is : ", number_vowels)

my-courses.net
The document scanning application, very famous on Google Play, had integrated a new advertising library that, in reality, contained an encrypted part that could download and install malicious code on the smartphone.
The developers of CamScanner, a very popular application on Android with over 100 million downloads, suddenly lost all their karma. Hitherto adored for the quality of their document scanning application, they are now plague victims. "You can not trust you anymore", "You have failed", "It's disgusting", "I want to be paid back", "CamScanner? Rather CamScammer "... can we read on Twitter.

## Thursday, August 29, 2019

#### Exercise 20

Write a program in Python language, to exchange the first and last characters of a given string.

#### Solution

# define example of string s
s = "my-courses.net"
# getting the len of string s
n = len(s)
#getting the first and last caracter of string s
first = s[0]
last = s[n-1]
# extracing the sub string by ignoring the first and last character
s1 = s[1:n-1]
# make up the new string by exchanging the first and last character
s2 = last + s1 + first
print(s2)

Younes Derfoufi
The Surface family would have little problems with endurance. In recent weeks, many users complain about the abnormal behavior of the battery of their devices.
It's been a few days now that Microsoft Surface enthusiasts are grumbling on forums and social networks. Many owners of Surface Pro 4, Pro 5, Pro 6 and Laptop 2 are experiencing battery problems with their favorite companions. Sudden discharges in full use, poor charging indications that lead to lower performance (Windows reduces the wings of components when the battery reaches a certain threshold) or significant loss of recharge capacity ... the menu is loaded. Microsoft must redouble its efforts to respond to its consumers on its support channels.

## Wednesday, August 28, 2019

#### Exercise 18

Write a program in Python that asks the user to enter a string s and return a message indicating whether the string contains the letter 'a' by indicating its position on the string. Example if the user types the string s = 'language' the program returns: The letter 'a' is in position: 1 The letter 'a' is in position: 5

#### Solution

# Ask user to input a string s
s = input("Type a string s : ")

# getting the len of string s
n = len(s)

# Browsing and reading all characters of string s
for i in range(0,n):
# Try if the browsed character is equal to character 'a'
if(s[i] == 'a'):
print("The letter 'a' is at position : ", i , " in the string s")

Younes Derfoufi
Concerns are many about the potential drifts related to artificial intelligence technologies. Bias in the processing of requests, poor security of biometric data, use of data without consent ... The topics are not lacking. To better regulate this sector, the European Commission would be working on a new regulation.

The European Union is already a world pioneer in data protection. It could soon consolidate this status with a new regulation on artificial intelligence. According to the Financial Times, in an article of August 22, 2019, the European Commission is currently working on a bill that would extend the rights of European citizens on their data related to the field of AI.

## Tuesday, August 27, 2019

#### Exercise 19

Write a program in Python that lists the strings that make up the list l = ["laptop", "iphone", "tablet", "printer", "Ipad"] by indicating the length of each string.

#### Solution

l = ["laptop", "iphone", "tablet", "printer", "Ipad"]
#browse and read all the items in the list l
for x in l:
print(x, " is in list l, its length is: ", len(x))

Younes Derfoufi

#### Exercise 17

Write a program in Python to display for a given string the number of occurrences of each character in the string.
Example for the string s = "Python.org" the program must display:
The character: "P" appears once in the string s
The character: "y" appears once in the string s
The character: "t" figure 1 time in the string s
The character: "h" appears once in the string s
The character: "o" appears twice in the string s
The character: "n" appears once in the string s
The character: " . "figure 1 time in the string s
The character:" r "figure 1 time in the string s
The character:" g "figure 1 time in the string s

#### Solution

s = "Python programming"
for x in s:
print("The number of appearance of the\
caraceter ", x, " in the chain s is :", s.count(x))

Younes Derfoufi
Data theft is increasing in the health sector, probably to accelerate research and development of new products.
Hospitals and medical research centers are currently among the favorite targets of ransomware writers. Highly publicized, these attacks unfortunately hide a reality no less brutal, that of the looting of health data. According to a recent report by the company FireEye, the main experts in this field are Chinese groups who apparently have been pounding the health sector with diligence and method since at least 2013.

## 1 - What is Python module ?

A Python module is simply a Python code file that can be called and used without having to copy it. A module can contain functions, classes, variables ... A module allows you to logically organize your Python code. Associating code in a module makes the code easier to understand and use.

#### Exercise 16

Write a program in Python language that asks the user to enter a string s and then display him all the characters contained in this string.
Example for s = "Python", the program displays the characters:
P
y
t
h
o
n

### First method by using the len() method of the string

# Ask to type a string s
s = input("Type a string s : ")

# getting the len of the string s
n = len(s)
for i in range(0, n):
print(s[i])

### Second method by accessing directly to the characters of string

# Ask to type a string s
s = input("Type a string s : ")
for x in s:
print(x)

Younes Derfoufi
Ten tech heavyweights, including Microsoft, Alibaba, Google, Intel and Tencent, announced Wednesday, August 21, 2019 the creation of the Confidential Computing Consortium (CCC), hosted by the Linux Foundation.

Ten tech giants announced Wednesday (August 21st) the formation of the Confidential Computing Consortium (CCC). It includes the Chinese Alibaba, Tencent and Baidu, the US Google Cloud, IBM, Microsoft, Intel and Red Hat, the Swisscom Helvetian and the British ARM.

## Sunday, August 25, 2019

#### Exercise 15

Write a program in Python language that asks the user to enter an integer n and display it if this number is prime or not.

#### Solution

# Ask to type a value of the integer n
n = int(input("Type a value of the integer n : "))

# use an auxiliary variable j that will count the number of divisors of n
j = 0
for i in range(1, n+1):
if(n%i == 0):
j = j + 1
if( j == 2):
print("The integer ", n , " is a prim number")
else:
print("The integer ", n , " is not a prim number")

Younes Derfoufi
After Baltimore (Maryland) and Riviera Beach (Florida), Texas is in turn victim of a major cyberattack. In the morning of Friday, 23 government institutions were the target of a ransomware, software that keeps the data and only makes them for ransom.

Launched in February 2019, the Password Checkup application allows users to check whether the credentials and passwords they use are safe, or if they are likely to have been hacked. Barely a month after launch, the official Chrome browser extension has detected many anomalies.

## Saturday, August 24, 2019

#### Exercise 14

Write a program in Python language that asks the user to enter an integer n and display it if this number is perfect square or not

#### Solution

# Ask to type a value of the integers n
n = int(input("Type a value of the integer  n :  "))
# we can use a compteur j
j = 0
for i in range(0,n):
if(i**2 == n):
j = j +1
if(j > 0):
print("The nteger ", n , " is a perfect square")
else:
print("The nteger ", n , " is not a perfect square")

my-courses.net

#### Exercise 13

Write a program in Python language that asks the user to enter two integers a and b and to display the quotient and the remainder of the Euclidean division of a by b.

#### Solution

# Ask to type a value of the integers a and b
a = int(input("Type a value of the integer  a  :  "))
b = int(input("Type a value of the integer  b  :  "))
q = a//b
r = a%b
print("The quotient of euclidean division of a by b is : q = ", q)
print("The remainder of euclidean division of a by b is : r = ", r)

my-courses.net
The publisher of Chrome wants to create a technology to make advertising targeting online while protecting the personal data of users. This quest for the Grail is based on a complex set of mathematical techniques.
The giant of Mountain View went in search of the five-legged sheep. In several blog posts, Google gives details of its new concept of "Privacy Sandbox", a set of web technologies capable of delivering to advertisers useful information on the personality of visitors to a site without revealing their identity and their lives private. In other words, the "Privacy Sandbox" will make it possible to know who one is dealing with without having to identify it in a unique way. A subtle nuance that - one suspects - is quite complex to achieve.
After Twitter and Facebook, YouTube turned off 210 channels after discovering they were "coordinating by uploading videos related to ongoing protests in Hong Kong," Shane Huntley said Thursday, Aug. 22, security analyst within the Google group, which owns the video platform.

## Friday, August 23, 2019

#### Exercise 12

1) - Write a program in Python that asks the user to enter an integer n and display the multiplication table of that number.
2) - Improve the program so that it displays multiplication tables of all numbers between 1 and 9

#### Solution

1) -
# Ask to type a value of the integer n
n = int(input("Type a value of the integer n "))
print("The multiplication table of : ", n," is :")
for i in range(1,10):
print(i , " x ", n, " = ",i*n)
2) -
for n in range(1,10):
#insert separator
print("--------------------------------------")
print("The multiplication table of : ", n," is :")
for i in range(1,10):
print(i , " x ", n, " = ",i*n)

Younes Derfoufi

#### Exercise 11

Write a program in Python that asks the user to enter an integer n and display all the divisors of that number.

#### Solution

# Ask to type a value of the integer n
n = int(input("Type a value of the integer n "))
# run through all integers lower than n
for i in range(1,n+1):
# try if i is a divisor of n
if(n%i==0):
print("the number ",i," is a divisor for the integer ",n)

Younes Derfoufi
Cyber ​​criminals have launched a phishing campaign, also called "phishing" since the end of July. They target individuals within companies through emails to achieve corporate data theft.

A phishing campaign (or "phishing") targeted since the end of July "specific individuals within companies" using Amazon's online hosting service, Amazon Public Cloud Storage, warned Wednesday, August 21 the company Proofpoint computer security system.

## Thursday, August 22, 2019

#### Exercise 10

Write a program in Python that asks the user to enter the radius of a circle and return the area and perimeter.

#### Solution

# import the pi number from math library
from math import pi
r = int(input("Type a value of radius r: "))
# calculate the perimeter of the circle
perimeter = 2*pi*r
# calculate the area of the circle
area = (pi**2)*(r**2)
print("The perimeter of circle with radius r =",r," is perimeter = ", perimeter)
print("The area of circle with radius r =",r," is area = ", area)

Younes Derfoufi

#### Exercise 9

Write a program in Python that asks the user to enter an integer n and display it the factorial n!

#### Solution

# Ask to type a value of the integer n
n = int(input("Type a value of the integer n "))
# define and initialize an auxiliary integer j
j = 1
for i in range(1,n+1):
j = j * i
print("The factorial the integer n is:  n! =  ", j)

Younes Derfoufi

#### Exercise 8

Write a program in Python that asks the user to enter an integer n and display the value of the sum 1 + 2 + ... + n = ?

#### Solution

# Ask to type a value of the integer n
n = int(input("Type a value of the integer n "))
# define and initialize an auxiliary integer j
j = 0
for i in range(1,n+1):
j = j + i
print("The sum 1 + 2 + 3 + ...+ n = : ", j)

Younes Derfoufi
MEDIA Experienced journalists will select relevant articles, but the bulk of the work will be done by algorithms.
Facebook launches in the online press. The social network confirmed this Tuesday the creation of a space "News", which will offer users the main information of the day.
The platform will draw on the experience of professional journalists to select relevant and reliable articles. Other content will be chosen by algorithms, which will determine and target the interests of Internet users according to their activity on the social network.
Hackers try to trap Internet users with cloned sites. To thwart the scam, it is important to always check the URL of the site you are consulting.
Updated on August 21st:

NordVPN informed us that the fake site that was usurping their identity is no longer active, which is good news. Unfortunately, nothing prevents hackers from using another URL that has not yet been blacklisted. So do not let your guard down.

## Exercise 7

Write a program in Python that asks the user to enter 3 numbers x, y, and z and display their maximum.

#### Solution

# Ask to type a values of the numbers a, b, c
a = int(input("Type a value of the number a "))
b = int(input("Type a value of the number b "))
c = int(input("Type a value of the number c "))
# define and initialize the maximum number
max = 0
if(a > b):
max = a
else:
max = b
if(max < c):
max = c
else:
max = max
print("The maximum of the three numbers a,b and c is : ", max)

Younes Derfoufi
The SSD WD_Black P50 Game Drive with NVMe technology and USB 3.2 2x2 interface is expected to beat record speed records.
Western Digital announces a new line of external hard drives and SSDs for players. The flagship of this WD_Black range is the SSD P50 Game Drive which is the first model with a USB 2.0 Gen 2x2 interface (20 Gbit / s theoretical), twice as fast as the current USB 3.1 Gen 2 interface (10 Gbit / s). Thanks to this interface and NVMe technology, according to the manufacturer, the P50 reaches 2000 MB / s in reading. Western Digital has not yet given any other information on the P50 Game Drive, which will be available in the fourth quarter of 2019, in capacities of 500 GB, 1 TB and 2 TB. The SSD will be delivered with a USB Type-C cable and a USB Type-A cable. It will be guaranteed 5 years.
In 30 minutes, the Galaxy Note 10+ recovers 66% of autonomy.
In 30 minutes, the Galaxy Note 10+ recovers 66% of autonomy. - 01net.com
Comes with a 25W charger, the Galaxy Note 10+ is Samsung's first high-end smartphone compatible with ultra-fast charging. Without breaking a record, the mobile becomes the champion of Galaxy.
Just arrived at the writing of 01net.com, the Samsung Galaxy Note 10+ is already suffering the "torture" of our laboratory. Major promise of this new generation of Samsung smartphones, the arrival of ultra-fast charging. Samsung replaces the 15W charger (USB-A to USB-C) usually used, by a 25W charger (USB-C to USB-C) and even offers an optional impressive charger of 45W.

## Tuesday, August 20, 2019

#### Exercise 6

Write a program in Python language that asks the user to enter their age and display the message "You're Major!" If the age typed is greater than or equal to 18 and the message "you are under age!" If the typed age is less than 18.

#### Solution

age = int(input("Type your age : "))
if(age > 18):
print("You are major !")
else:
print("You are minor !")

Younes Derfoufi
Twitter and Facebook may be blocked by the Chinese government, but it obviously does not prevent Beijing to use these networks for propaganda purposes. Chinese authorities have used nearly a thousand Twitter accounts, and to a lesser extent Facebook pages, to discredit and divide pro-democracy protesters in Hong Kong, the two social networks said on Monday.
Twitter suspended 986 accounts, "coordinated as part of a Chinese state-backed operation" to "undermine the legitimacy and political positions" of protesters, says Twitter in a blog post. "We have identified large sets of accounts that behave in a coordinated way to amplify the messages about the Hong Kong protests," said the California group.
Despite US sanctions, Huawei's sales increased by nearly 31% in China.
After announcing HarmonyOS to no longer depend on Android, the Chinese tech giant is working on a mapping software. One more step towards the emancipation of Huawei towards Google and its services.
Despite peaceful relations, the technological and commercial war between the United States and China does not stop. Latest announcement: Huawei is developing its own mapping service.
It was possible to access the contents of the password manager even if a master password was set.
Mozilla recently released Firefox Update 68.0.2. This plugged a flaw that allowed to steal the content of the integrated password manager browser by a simple copy and paste, even if the user has set a master password. All that was needed was to go to the "Options -> Privacy and security" menu, open the "Registered identifiers ..." panel, right click on one of the entries and choose "Copy word from past ". But at no time did the browser request the entry of the master password. Since the update, it is now the case.

## Monday, August 19, 2019

#### Exercise 5

Write a program in Python language that asks the user to enter their integer number and to display it if this number is even or odd

#### Solution:

# Ask to type value of n
n = input("Type value of the integer n : ")
# Convert n to int
n = int(n)
# Try if n is evn
if(n%2 == 0):
print("The integer n typed is even ")
else:
print("The integer n typed is old ")

Younes Derfoufi

#### Exercise 4

Write a program in Python language that displays the first 100 integers

#### Solution:

for i in range(0,101):
print(i)
""" this will display at execution the first 100 numbers :
0
1
2
.
.
.
100
"""

Younes Derfoufi

## 1 - What is comment in Python

Programming languages ​​provide a notation for inserting comments into the code, that is, text that will be ignored when the program is run. Comments can be used to explain a complicated part of a program, or to put indications in the code, like the source code, the language version...

## What is an exception

An exception is an operation performed by an interpreter or compiler when an error is detected during the execution of a program. As a general rule, the execution of the program is interrupted, and a more or less explicit error message is displayed.

## Definition of computer terms beginning with the letter A

#### ActiveX

Microsoft's technology to install programs over the Internet that add additional features to your browser (the program you are surfing the Internet with). This technique is sometimes hijacked by spyware writers.

"Ad Hoc" mode is a mode of operation that allows computers connected directly to a Wi-Fi network card to be connected directly, without the use of third-party hardware such as an Access Point (AP).
Although easily guessed, the date of the next Apple keynote seems more and more certain thanks to a leak in the 7th beta of iOS 13.
Published yesterday, the seventh beta of iOS 13 may reveal the date of the next keynote Apple. Digging through the code for this update, the iHelp BR site has spotted new screenshots seemingly for the configuration menu when you first start an iPhone. The calendar icon replaces the date of September 12, 2018 with that of September 10, 2019.

#### Exercise 3

Write a program in Python that asks the user to enter two numbers a and b and to display their maximum

#### Solution:

a = int(input("Type value of the number a : "))
b = int(input("Type value of the number b : "))

if (a > b):
print("The maximum of a and b is : a = ",a)
else:
print("The maximum of a and b is : b = ",b)

Younes Derfoufi

#### Exercise 2

Write a program in Python that asks the user to enter two numbers a and b and display their sum: a + b.

#### Solution

a = input("Type value of the number a : ")
b = input("Type value of the number b : ")
# Convert string value to integer
a = int(a)
b = int(b)
s = a+b
print("The sum of a and b is  : " , s)

Younes Derfoufi

## Friday, August 16, 2019

#### Exercise 1   Back to the list of exercises

Write a program in Python language that asks the user to enter their name and display their name with a welcome message!

#### Solution

name = input("Type your name : ")
print("Welcome : " , name)

Younes Derfoufi

# Note: The exercises are note ranked in order of difficulty !

## Python practice : Exercises with solution

### Part 1- exercises on strings and lists

#### Exercise 1 || Solution

Write a program in Python language that asks the user to enter their name and display their name with a welcome message!

#### Exercise 2 || Solution

Write a program in Python that asks the user to enter two numbers a and b and display their sum: a + b.

## 1 - The concept of OOP in Python

Object-oriented programming (OOP) is a type of programming based on the creation of classes and objects via a method called instantiation. A class is a prototype (model) encoded into a programming language whose goal is to create objects with a set of methods and attributes that characterize any object in the class. The attributes are data types (class variables and instance variables) and methods, accessible via point concatenation. In object-oriented programming, the declaration of a class groups together methods and properties (attributes) that are common to a given object. Thus one could say that a class represents a category of objects. It also appears as a factory for creating objects with a set of common attributes and methods.
Microsoft has patched vulnerabilities to create worms on Windows 7, Windows 8 and Windows 10. The publisher has also corrected a 20-year-old loophole to elevate privileges.
Yesterday, on the occasion of its Patch Tuesday, Microsoft released patches to be installed urgently, if it is not already done. Indeed, they clog a series of ultra-critical flaws, particularly affecting the latest versions of the operating system. Two flaws similar to "BlueKeep" have been found by Microsoft security researchers (CVE-2019-1181 and CVE-2019-1182).

To find out if your MacBook is concerned, visit the Apple website.

Recalled for a faulty battery problem, a few thousand 15-inch MacBook Pro (generation mid-2015) are no longer allowed to fly. Airlines are starting to ban the use of the device.
In late June, Apple launched a recall program for its 15-inch MacBook Pro (mid-2015 generation) sold between September 2015 and February 2017. The brand has identified a battery problem that could overheat. The Apple site lets you know if your computer is concerned and ask for a free repair.
This is part of the effort of the social network to facilitate its use to newcomers. They will thus be able to become familiar with their use more quickly.
Twitter continues to simplify its access. The social network announced this August 13 that it will soon be possible to follow specific topics in the same way that we are currently monitoring accounts.

## 1 - Define string in Python

A string variable in Python is sequence of characters that follow each other and delimited by double or single quotas "..." or '...'. A string which does not contain any characters is called an empty string.

#### Example

s1 = "Hello !"
s2 = 'welcome !'
print(s1) # this will display :
Hello print(s2) # this will display : welcome

## 2 - Access the elements of a string variable

The brackets can be used to access the string elements.

## 1 - Define a Python Set

A set in Python(Python set) is an unordered and unindexed collection.
In Python, sets are written with braces {....}.

#### Creating a set:

mySet = {"Pen", "Pencil", "Eraser"}
print(mySet)
# Poster: {'Eraser', 'Pencil', 'Pen'}

#### Note

Sets are not ordered, so items will appear in random order.
Microsoft warns against BlueKeep II & III. The publisher considers them "wormable" just like the original BlueKeep vulnerability.
Microsoft announced today that it has fixed two new major security vulnerabilities in the Windows Desktop Services package.

After the TV presenters and even a virtual judge, the Chinese search engine Sogou will propose avatars of authors of novels for audio books, in partnership with Zhangyue Technology.
The audio book market is booming in China. To meet the demand in a qualitative way, the Chinese search engine Sogou (subsidiary of Tencent) wants to apply artificial intelligence techniques. He announced on August 9, at the China Online Literature Conference (COL +), the project of intelligent professional avatar Yanny. It combines speech synthesis, image recognition and predictive capabilities to create realistic avatars.

## Wednesday, August 14, 2019

Qualcomm announces this August 14, 2019, its collaboration with Russian telecom operators and the Moscow authorities to develop a 5G millimeter wave network by autumn. It will be the first network using millimeter waves on the European continent.
The first 5G millimeter wave network of the European continent is set to open in the autumn, in the Moscow city of Russia. This is the announcement made by the American company Qualcomm on Tuesday, August 14, 2019, which adds that the project is conducted in partnership with the Department of Information Technology of Moscow and Russian mobile operators.

## 1 - Define a dictionary in Python

A dictionary is a Python implementation of a data structure similar to an associative array. A dictionary consists of a collection of key-value pairs. Each key-value pair has the key attached to its associated value. A dictionary can be defined by enclosing braces {} with a list of key-value pairs separated by commas.

#### Syntax:

dic = {key1: value1, key2: value2, key3: value3, ...}
To access a value from the dictionary, use the name of the dictionary followed by the corresponding key in square brackets:

#### Example

dic = {key1: value1, key2: value2, key3: value3, ...}
print (dic [key1]) # this will display : value1

## 1 - The For loop in Python ...

The for loop in Python, allows to execute repeated instructions.

#### Sytax:

for counter in range(start_counter, end_counter):
instructions...

#### Example. display the first 10 numbers

for i in range (1,11):
print(i)
#prints the first 10 numbers 1, 2, ..., 10

#### Note

Note that in the loop for i in range(1, n) the last one which is n is not included! This means that the loop stops at order n-1.
Endowed with important privileges of access, the computer pilots are unfortunately not always of a high quality. They are therefore a serious Achilles heel for Windows systems.
To interact with the hardware components to which it has access, the Windows operating system relies on an army of small software very practical: drivers or computer drivers. Unfortunately, these programs can also introduce serious security vulnerabilities, as security researchers at Eclypsium have just shown, at the recent DEF CON conference in Las Vegas.
After earning more than a billion dollars, Tumblr sold for a few million to Wordpress
The publisher of Wordpress has bought the blogging platform for an estimated amount of just over \$ 10 million. The fall in value seems strongly linked to the ban on adult content.
Tumblr is still changing owners. The platform that hosts more than 450 million blogs has been sold by operator Verizon Automattic, the publisher of Wordpress, another major player in blogging. If the amount has not been disclosed, it is estimated by the US press between \$ 10 and \$ 20 million.
Now just scan your fingerprint or unlock to connect to a Google service from the Chrome browser on Android. This method is based on the FIDO2 standard.
The password, this authentication method that we all hate, loses a little more ground on Android. Google has announced that some of its services are now accessible without a password from the Chrome browser on Android. To authenticate, simply scan your fingerprint or perform a screen unlock gesture.

## 1 - The selective structure If

This structure is one of the most important in programming. The idea is to say that if such a condition is satisfied then, execute an instruction or a block of instructions that otherwise execute other instructions ...
Take the following example:

## Tuesday, August 13, 2019

After several months of rumors, Huawei officially unveiled this Friday, August 9, 2019 its home operating system for smartphones and connected objects. The Chinese telecom giant is taking a step closer to abandoning Android, Google's OS, that it may one day be forced to no longer use because of US sanctions.
Rumors have been running for months on the alternative developed in secret by Huawei in case he could no longer use the operating system of Google, Android, because of US sanctions. The telecom giant finally shot down its cards Friday, August 9, 2019, at the Huawei Developer Conference held in Dongguan (China).
The end of Google Chrome 76's private browsing mode detection has only been temporary. Two new methods to detect the incognito mode of the browser have just been discovered.
By updating its Chrome web browser to version 76, Google hoped to put an end to the detection of private browsing. This questionable practice was used by some websites to prevent their visitors from accessing their content in an unlimited way.

## 1 - Define a tuple in Python

A tuple is an orderly and non-modifiable collection (n-tuples in mathematics). In Python, tuples are written with parentheses.

#### Example. Creating a tuple:

myTtuple = ("Java", "Python", "php")
print (myTuple)
# output: ('Java', 'Python', 'php')

You can access the elements of a tuple by referring to the index number, enclosed in square brackets:

To improve the Skype translation system, Microsoft uses independent workers. They can, as part of their work, access confidential dialogues.
Imagine that someone teleworking, in their pajamas in front of their computer, could listen to a conversation you had on Skype, or even make fun of it with their friends. This is the situation in which some Microsoft providers may find themselves, reveals this August 7th Motherboard.

The social network would be in negotiation with American media. He would be willing to pay several million dollars per license.
Facebook has approached prestigious media to appear in a future tab News which must leave before the end of the year in the United States. Licenses could be as high as \$ 3 million a year and should be for a period of three years. Among the companies contacted, there would be Walt Disney Co.'s ABC News, The Wall Street Journal, The Washington Post and Bloomberg.

Facebook boss Mark Zuckerberg released Wednesday, March 6, 2019 a forum on his social network. He looks back on the group's strategy, which he believes should make a shift toward greater privacy for their users.
It is a long time ago, when Mark Zuckerberg felt that privacy was a "social norm exceeded". Nearly ten years after this media release, Facebook boss took the pen Wednesday, March 6, 2019 to deliver his vision of the future of its social networks. "I imagine that a platform based on secure communications will surpass today's open platforms.Privacy gives users the freedom to be themselves and to join more naturally," said Mark Zuckerberg, in a long text that resembles a half-hearted apology following the Cambridge Analytica scandal that rocked the Internet giant in 2018.

The American start-up Hyp3r, Instagram's advertising partner, has collected and uploaded the location data of millions of social network users. The subsidiary of Facebook, so far spared by the scandals around data protection that splash his group, announced Wednesday to have ended their collaboration.
It was one of the few social networks not yet pinned for poor personal data management. Instagram announced Wednesday, August 7, 2019 has "blocked" one of its advertising partners, the marketing specialist geolocated Hyp3r. What is criticized by the subsidiary of Facebook? The collection of location data and the tracking of millions of users, which would have allowed him to establish a database of profiles to determine the centers of interest and travel of each. The company monitors publications by location to retain potential customers.

## Saturday, August 10, 2019

Google extends Google Maps augmented reality navigation mode compatibility. It is now available on more Android smartphones, but also iPhones. This feature called Live View is intended for GPS navigation on foot and allows to see directions directions superimposed on the real world via the smartphone screen.

my-courses.net

Amazon Web Service does not intend to rest on its laurels. The leading cloud company has increased the number of ads at Re: Invent 2018, the event for the user and vendor community taking place November 26-30 in Las Vegas. Nothing seems to resist the company which announces new services concerning the databases as well as the races of models of autonomous cars, the blockchain or the machine learning. All while keeping the model that makes the success of the brand: the famous "as a service".

my-courses.net

Broadcom announced on August 8 the acquisition of Symantec's enterprise security software for \$ 10.7 billion (9.6 billion euros), continuing its series of acquisitions in the software field.
Symantec sells its Broadcom business for \$ 10.7 billion Broadcom announced Thursday the acquisition of Symantec's enterprise security software for \$ 10.7 billion (9.6 billion euros), continuing its series of acquisitions in the field of software.