Control flow basics

Python if else

There comes situations in real life when we need to make some decisions and based on these decisions, we decide what should we do next. Similar situations arises in programming also where we need to make some decisions and based on these decisions we will execute the next block of code.

Decision making statements in programming languages decides the direction of flow of program execution. Decision making statements available in python are:

  • if statement
  • if..else statements
  • nested if statements
  • if-elif ladder
  • Short Hand if statement
  • Short Hand if-else statement

if statement

if statement is the most simple decision making statement. It is used to decide whether a certain statement or block of statements will be executed or not i.e if a certain condition is true then a block of statement is executed otherwise not.

Here, condition after evaluation will be either true or false. if statement accepts boolean values – if the value is true then it will execute the block of statements below it otherwise not. We can use condition with bracket ‘(‘ ‘)’ also.

As we know, python uses indentation to identify a block. So the block under an if statement will be identified as shown in the below example:

if condition:               # Statements to execute if    # condition is true
if-statement-in-java

if- else

The if statement alone tells us that if a condition is true it will execute a block of statements and if the condition is false it won’t. But what if we want to do something else if the condition is false. Here comes the else statement. We can use the else statement with if statement to execute a block of code when the condition is false.
Syntax:

if (condition):
    # Executes this block if
    # condition is true
else:
    # Executes this block if
    # condition is false

Flow Chart:-

Data types basics

Python | Set 3 (Strings, Lists, Tuples, Iterations)

Last Updated: 20-10-2020

In the previous article, we read about the basics of Python. Now, we continue with some more python concepts.

Strings in Python 
A string is a sequence of characters. It can be declared in python by using double-quotes. Strings are immutable, i.e., they cannot be changed.

Assigning string to a variable
 a = "This is a string"
 print (a) 

Lists in Python 
Lists are one of the most powerful tools in python. They are just like the arrays declared in other languages. But the most powerful thing is that list need not be always homogeneous. A single list can contain strings, integers, as well as objects. Lists can also be used for implementing stacks and queues. Lists are mutable, i.e., they can be altered once declared.

# Declaring a list 
L = [1, "a" , "string" , 1+2] 
print L 
L.append(6) 
print L 
L.pop() 
print L 
print L[1] 

The output is :  

[1, 'a', 'string', 3]
[1, 'a', 'string', 3, 6]
[1, 'a', 'string', 3]
a


Tuples in Python 
A tuple is a sequence of immutable Python objects. Tuples are just like lists with the exception that tuples cannot be changed once declared. Tuples are usually faster than lists.

Example

Create a Tuple:

thistuple = ("apple", "banana", "cherry")
print(thistuple)

Operators basics

  1. Arithmetic operators: Arithmetic operators are used to perform mathematical operations like addition, subtraction, multiplication and division.
OPERATORDESCRIPTIONSYNTAX
+Addition: adds two operandsx + y
Subtraction: subtracts two operandsx – y
*Multiplication: multiplies two operandsx * y
/Division (float): divides the first operand by the secondx / y
//Division (floor): divides the first operand by the secondx // y
%Modulus: returns the remainder when first operand is divided by the secondx % y
**Power : Returns first raised to power secondx ** y

Example:

for example, open any of your text editor(notepad/notepad++), then copy the code below

a = 9
b = 4
#Addition of numbers
add = a + b 
#Subtraction of numbers
sub = a - b 
#Multiplication of number
mul = a * b 
#Division(float) of number
div1 = a / b 
#Division(floor) of number
div2 = a // b 
#Modulo of both number
mod = a % b 
#Power
p = a ** b 
print results
print(add) 
print(sub) 
print(mul) 
print(div1) 
print(div2) 
print(mod) 
print(p) 

Save this file with test.py, then search your Command Prompt (.cmd) in your windows, open it, then type: python test.py, or python3 test.py.

Output:

13 5 36 2.25 2 1 6561

C++ input and output basics

Input and output are among the first concepts every C++ learner meets. They seem simple at first, but they are fundamental because nearly every real program needs to read something, display something, or store something in a file.

Console Output with cout

The standard output stream is usually accessed through cout.

#include <iostream>
using namespace std;

int main() {
    cout << "Hello, world!" << endl;
    return 0;
}

Console Input with cin

You can read user input with cin.

#include <iostream>
using namespace std;

int main() {
    string name;
    cin >> name;
    cout << "Hello, " << name << endl;
    return 0;
}

A Common Beginner Mistake

Using cin >> name only reads input until the first space. If you want a full line such as Thanh Nguyen, use getline instead.

File Output

C++ also supports file streams for reading and writing files.

#include <fstream>
using namespace std;

int main() {
    ofstream file("output.txt");
    file << "Stored text" << endl;
}

Why This Matters

Once you understand input and output, you can start building tools that interact with users, process data files, or write logs. That is the point where a learning exercise starts becoming a real program.

Final Thoughts

C++ input and output are simple to begin with, but they open the door to practical programming. Mastering these basics makes it much easier to move on to file processing, configuration handling, and larger applications.

Python projects worth building

Learning Python becomes much easier when you build things that solve real problems. Tutorials help, but projects are what turn syntax into skill. The best beginner and intermediate projects are small enough to finish and useful enough to teach good habits.

Project Ideas That Are Worth Building

1. Log Analyzer

Read a log file, count error messages, group them by level, and export a short report. This teaches file I/O, loops, string processing, and simple data structures.

2. API Data Fetcher

Call a public API, store selected fields, and print a summary. This teaches HTTP requests, JSON parsing, and error handling.

import requests

response = requests.get("https://api.github.com/repos/python/cpython")
data = response.json()
print(data["stargazers_count"])

3. CSV Cleaner

Take messy CSV input, normalize column names, remove invalid rows, and write a cleaned file. This is very close to real engineering work.

4. Deployment Helper Script

Build a CLI tool that runs tests, tags a release, or validates environment variables before deployment.

What Good Projects Teach

  • how to structure code into functions,
  • how to handle bad input,
  • how to log useful information,
  • and how to make tools that others can actually use.

A Good Rule

Do not chase huge project ideas too early. A finished 150-line script that solves one real problem is often more valuable than a half-built web app that never works.

Final Thoughts

If you want to learn Python seriously, build small tools with clear outcomes. Practical projects create momentum, and momentum is what turns learning into engineering ability.

C++ basics

C++ is a general-purpose programming language known for performance, control over memory, and strong support for systems programming. Even today, it remains one of the most important languages in robotics, game engines, real-time systems, embedded software, and high-performance applications.

Why C++ is still relevant

  • Excellent runtime performance
  • Fine-grained control over memory and resources
  • Strong support for object-oriented and generic programming
  • Huge adoption in performance-sensitive domains

Where C++ is commonly used

  • Robotics and ROS
  • Autonomous driving software stacks
  • Game engines
  • Operating systems and embedded software
  • High-frequency and low-latency systems

A simple example

#include <iostream>
#include <vector>

int main() {
    std::vector<int> values = {1, 2, 3, 4};
    for (int v : values) {
        std::cout << v << std::endl;
    }
    return 0;
}

Why learning C++ helps engineers

C++ teaches important ideas about memory, object lifetime, abstraction cost, compilation, and performance trade-offs. Even if you later spend more time in Python, knowing C++ often makes you a stronger engineer.

Final thoughts

C++ is not always the easiest language to learn, but it is one of the most valuable languages if you want to build fast and robust software close to the system level.

Work-life balance in germany

The issues around finding the balance between family life, private life and work are gaining increased attention in political and business circles in Europe and Germany.

A key issue for many workers is flexible working time in order to have a work-life balance. Negotiating a work/life balance can help enable parents (both men and women) to reconcile their work with their family lives and women in particular to participate in the labour market. Finding the right work-life balance can allow workers to take leave from work so that they can participate in education or training or take up an interest, hobby or leisure pursuit. This may mean that employees can reorganise their working lives and hours around shorter days, weeks, months or years.

German families tend to be small with only one or two children. The men are still quite often considered to be the head of the household, even though both the wife and husband work.

At the turn of the century few employees in Germany were given holidays. In 1902, the metal and brewing industries gave three days annual leave to their workers. It was not until 1974 that the old Federal Republic introduced the statutory minimum holiday of 18 working days which has now risen to a minimum of 24 days. Today most collective wage agreements provide for holidays of six weeks or more and most employers give  holiday pay.

National holidays

Germany has quite generous holidays in comparison to other European countries. There are more public holidays in Germany than in any other European country. On these days, banks and most shops are closed, including supermarkets. However, many restaurants remain open. Public transportation and other services are also available. Many shops and businesses are also closed on Carnival Rose Monday (Cologne and Rhine region), Christmas Eve and New Year’s Eve although these are not official holidays.

Overview of legal holidays:

New Year                
Epiphany                   
Good Friday              
Easter Monday               
Labour Day               
Ascension                  
Whit Monday             
Corpus Christi                       
Assumption Day        
Day of German Unity            
Reformation Day       
All Saints’ Day                       
Penance Day              
Christmas                  
St. Stephen’s Day
01.01
06.01   (celebrated in BW, BY, ST)
around March/April
around March/April
01.05
May
May
May/June (celebrated in  BW, BY, HE, NW, RP, SL)
15.08   (celebrated in  BY, SL)
03.10
31.10   (celebrated in  BB, MV, SN, ST, TH)
01.11   (celebrated in BW, BY, NW, RP, SL
21.11   (celebrated in SN)
25.12
26.12

(Those States where the public holiday applies are shown in brackets; if nothing is indicated the holiday applies to all of Germany.)

Working hours

Opening hours

In Germany, businesses and shops are not legally allowed to stay open as long as they please and there are strict regulations concerning opening and closing hours. The German federal law “Ladenschlussgesetz” (Shop Closing Law) together with individual regulations in different States controls opening hours. Thus supermarkets for example close at 22.00 at the latest and open before 9 a.m. or 10 a.m. On Sundays almost everything is closed with the exception of bakeries and petrol stations.

 Working times

The German Working Time Regulations (“Arbeitszeitgesetz”) regulate working hours on a legal basis. They are based on the European regulation 93/104/EG. In addition, most industries have collective agreements that regulate working hours and holidays. However, it can be said, that a working week of more than 48 hours on average during a  6 month period must not be exceeded. Furthermore, Sundays and national holidays are non-working days.

Working culture

Germans see themselves as modern, liberal and cultured, and working practices are formal and professional. The following outlines the working practices that you should be familiar with before investing in Germany:

  • Though long-term relationships are considered very important, friendships are usually not developed too quickly. It may take some time before personal names are used between non-familial parties.
  • German business culture has a well-defined and strictly observed hierarchy, with clear responsibilities and distinctions between roles and departments.
  • Professional rank and status in Germany is generally based on an individual’s achievement and expertise in a given field. Academic titles and backgrounds are important, conveying an individual’s expertise and thorough knowledge of their particular area of work.
  • An important aspect is Germany’s work ethic. Employees define themselves as part of the corporation they are working for and quickly identify themselves with its product and/ or services.
  • Rank is very important in business. Never set up a meeting for a lower ranked company employee to meet with a higher ranked person.
  • Notwithstanding what has been said previously, today over half of all university graduates are women. Female students are well represented in the professions; they lead in some fields such as medicine and law. The new availability of qualified female graduates is likely to bring great changes in the German workplace of the future.
  • Pay and power inequalities are still present however. Male employees tend to receive higher wages than their female counterparts. Jobs considered as being “women’s work” typically pay less than those deemed “men’s work”.
  • In more traditional companies, it is still generally true that everything is run by committees, things are discussed in great length and risk taking is not as common as in other countries.
  • There is one philosophy for almost everybody in German business: if someone says he is going to do something, he will do it. The same is expected of others as well. Never make a promise that you cannot keep or offer something that you cannot deliver. Germans dislike and do not trust unreliable people.
  • There is no legislated or administratively determined minimum wage. Collective bargaining agreements set minimum pay rates and are enforceable by law for an estimated 80 to 90 per cent of all wage and salary earners
  • Federal regulations limit the working week to a maximum of 48 hours, but collective bargaining agreements may supersede these. Contracts that directly or indirectly affect 80% of the working population regulate the number of hours of work per week.
  • The average working week is around 40 hours; rest periods for lunch are accepted practice. Provisions for overtime, holidays, and weekend pay vary depending upon the applicable collective bargaining agreement.
  • An extensive set of laws and regulations govern occupational health and safety. A comprehensive system of worker insurance enforces safety requirements in the workplace.

It is important that these issues are examined and understood before setting up a company and employing a workforce in Germany. These issues differ all over Europe but legal guidelines are set by the European Commission.

Health insurance

Germany’s health care system provides its residents with nearly universal access to comprehensive high-quality medical care and a choice of physicians. Over 90% of the population receives health care through the country’s statutory health care insurance programme. Membership of this programme is compulsory for all those earning less than a periodically revised income ceiling. Nearly all of the remainder of the population receives health care via private for-profit insurance companies. Everyone uses the same health care facilities.

Building a tech career in europe

A salary target like 70,000 euros per year in IT is possible in Europe, but it usually does not happen by accident. It comes from a combination of technical depth, business value, communication, and market positioning.

1. Focus on Skills That Companies Actually Pay For

Salary grows faster when your skills solve expensive problems. Areas that often have strong demand include:

  • cloud infrastructure,
  • DevOps and platform engineering,
  • backend development,
  • data engineering,
  • security,
  • and applied AI engineering.

2. Build Evidence, Not Only Knowledge

Many candidates say they know Docker, Kubernetes, Python, or Terraform. Fewer can show real projects. A portfolio, GitHub repository, technical blog, or measurable production work can make a big difference.

3. Learn to Communicate Value

Higher salaries are not only for people who write code. They are also for people who explain tradeoffs clearly, reduce risk, improve systems, and help teams deliver faster.

For example, saying:

I built a CI/CD pipeline

is much weaker than saying:

I reduced release time from 2 hours to 15 minutes by introducing automated testing and deployment pipelines

4. Choose Market and Location Carefully

Salary levels vary a lot across Europe. Germany, the Netherlands, Switzerland, Ireland, and some remote-first companies often offer stronger compensation than smaller markets. Company type matters too: product companies and high-impact infrastructure teams often pay more than low-margin outsourcing roles.

5. Keep Improving Your Position

  • Improve English communication.
  • Negotiate based on market data and impact.
  • Switch roles when growth is capped.
  • Develop one strong specialty and one broad supporting skill set.

Final Thoughts

Reaching a stronger IT salary in Europe is usually the result of intentional growth. The goal is not only to know more technology. The goal is to become the kind of engineer who can solve important problems reliably and communicate that value well.

Us election 2020 live reactions

Combination picture of Democratic U.S. presidential nominee Joe Biden and US President Donald Trump speaking about the early results of the 2020 election on 4 November 2020
image captionThe result of Tuesday’s election hangs in the balance

The information I show in this post only represent for my idea. A Vietnamese engineer in Europe.

Before we discuss further, let’s update some information about the Election in American first:

Democratic candidate Joe Biden has pulled ahead of Donald Trump in Pennsylvania, a key state in the US presidential race, voting data shows.

If Mr Biden takes the state, he would secure his victory in the election. The state has 20 Electoral College votes.

According to the most recent data, Mr Biden is leading by more than 5,500 votes, with 98% counted.

Earlier, Mr Biden edged ahead of his Republican rival in Georgia, another key battleground state.

He is leading there with more than 1,000 votes, with 99% of the ballots counted.

No news organisation has yet projected it as a Biden win. Georgia is a traditionally Republican state and has not been won by a Democrat since 1992.

If Mr Biden wins Pennsylvania, the state where he was born, he would have 273 votes in the electoral college – enough to clinch the victory.

Pennsylvania has always been a major political battleground. The state voted Democrat in six consecutive races before it swung to Mr Trump in 2016.

Paths to victory

How about Asian-American, what they think and who they want to be the 46th president of US. And this is what I found from internet.

Indian-Americans voted for Biden, Vietnamese-Americans supported Trump.

According to post-voting polls, about 64% of Asian American voters support Biden, while 30% of them vote for Trump.

These figures are similar to 2016, but lower than the numbers Obama collected in 2012.

Asian Americans were the fastest growing minority of voters eligible to vote. Although this group’s voter rate is still less than 5%, it may still be the deciding factor in fluctuating states.

According to the Asian-American Voter Survey, the Republican Party has gradually received support from this group in recent years, but nearly two-fifths of Asian-American voters have yet to register as a member of either two parties, meaning they may be “undecided voters”.

Asian-American voters are far from other blocs. They come from many different backgrounds, including country of origin, culture, religion and generation. According to the survey above, Indian Americans tend to vote for Biden the most, while Vietnamese Americans tend to favor Trump.

Although President Trump has been widely criticized for calling Covid-19 “the Chinese virus”, he has received enthusiastic support from a number of Chinese Americans.

Chenren Shao, a 35-year-old Chinese-American Republican voter in Maryland, said he was not offended by the term, as the virus started to emerge from China.

In addition, similar to the Cuban Americans who supported Trump, many Chinese immigrants who criticized Beijing have also praised Trump for claiming he stood up against communism.

Historically, both of these major parties have not had adequate access to Asian-American voters, resulting in a low turnout rate in this group. But in the near future, this electoral block will become large so that politicians must pay more attention.

Living in europe as an engineer

Living in Europe can be a valuable experience not only for travel, but also for professional growth. For engineers, it creates a different view on work culture, quality of life, mobility, and long-term planning.

What Feels Different

  • Mobility: it is easier to visit different cities and countries, which broadens perspective very quickly.
  • Work culture: planning, documentation, and process often receive more attention.
  • Public systems: transport, insurance, and administration can feel strict, but they also teach structure.

Why It Matters Professionally

Living in Europe can improve your career in indirect but important ways. You learn to communicate across cultures, adapt to new systems, and make decisions with limited information. Those skills are very relevant in software and infrastructure work.

What Helps in Practice

  • Keep your paperwork organized from the beginning.
  • Learn enough of the local language to handle daily tasks confidently.
  • Build a steady routine for work, learning, and health.
  • Spend time understanding how local tax, insurance, and rental systems work.

A Balanced View

Life in Europe is not automatically easy. There is bureaucracy, language friction, and sometimes social distance at first. But for many people, the tradeoff is worth it because the environment encourages stability, growth, and independence.

Final Thoughts

For me, living in Europe has been useful not only as a life experience, but as a way to become more disciplined, more adaptable, and more thoughtful about the kind of work and life I want to build.