Skip to main content

Getting Started With Python (2) - Output of Print() function

After doing the installation and try on familiarize with IDLE Python and editor window, in this post, let's try to dig deep on print() function.

Run the IDLE,

Enter the following command :
     print("Anityo Nugroho")

The result will be :
     Anityo Nugroho

Next :
     print("Anityo Nugroho","engineer")
The result will be :
     Anityo Nugroho engineer

Another example which is variable :
     blog="Beginner in Python"
     print(blog)
The result will be :
     Beginner in Python

The above example in IDLE :

Let's combine variable with another string :
     print(blog,"Anityo Nugroho")
The result output will be :
     Beginner in Python Anityo Nugroho

Next, to try the output using integer :
     print(25)
It will give the output :
     25

Other example using decimal number :
     print(358.22458)
Result will be :
     358.22458



There is a difference in Python when we use strings and number for print() function. Number, can be entered without quotation marks and also strings in the form of variable.

Separator
Let us try some examples on separator :
     print("Anityo","Nugroho","Graham","Aker"); print()
     print("Anityo","Nugroho","Graham","Aker",sep="\t"); print()
     print("Anityo","Nugroho","Graham","Aker",sep="|"); print()
     print("Anityo","Nugroho","Graham","Aker",sep=""); print()
   
The output will be :

the second print() on every line added using a ; semicolon, to gives a line space between each equation.
The different between the first and second example, with sep="\t" as separator, output of the following names with a tab between each name.

It is the same if we apply on numbers, example :
     print(12,24,36,48,sep="**")
It will give the output :  
     12**24**36**48

Other separator that like to try is \n
Example :
print("Python","\n","Beginner Walk","\n","year 2018","\n"); print()
print("Python","Beginner Walk","year 2018",sep="\n"); print()


it will give output :

To avoid spaces between output (like on example 1), addition of \n as separator just once in the code (example 2).

Let's work with output on both string and number :
Example :
print("Anityo Nugroho,38"); print()
print("Anityo Nugroho",38); print()

Result will be :

The following codes to make a good quote :

The output will be :









Comments

Popular posts from this blog

Satellite Communication - Part 4 (CPI)

Cross Polar Isolation (CPI) In installation and pointing/peaking antenna, Orthogonal Mode Transducer (OMT) must be set to be as precise as possible to get the best CPI value. above is picture of OMT Feed assembly include with BUC and LNB The minimum value for CPI is 30 dB (better will be good) in Linier Polarized Antennas. The reason is for our receive (Rx)-side as not to get interferenced (distrubed) by other (polarity) Down-Link users, therefore our transmit (Tx) shoild as well not interfere other users that operates at 90 deg (Orthogonal) Polarization. Note : In LH/RH Circular Polarizations, usually CPI of 27dB (=AR of 1.09) is acceptable enough. picture above is careless/miss-aligned OMT setting

Satellite Communication : Transmission Bands

A satellite link is a radio link between a transmitting earth station and receiving earth station through a communications satellite. A satellite link consists of one uplink and one downlink; the satellite electronics (i.e., the transponder) will remap the uplink  frequency to the downlink frequency. The transmission channel of a satellite system is a radio channel using a direct-wave approach, operating in at specific RF bands within the overall electromagnetic spectrum as seen below : The table below shown some key of physical parameters of relevance to satellite communication,  The frequency of operation is in the super high frequency (SHF) range (3-30 GHz). Regulation and practice dictate the frequency of operation, the channel bandwidth, and the bandwidth of the subchannels within the larger channel. Different frequencies are used for the uplink and for the downlink. Frequencies above about 30 MHz can pass through the ionos...

High Throughput Satellite Service - more than modems and transmission

The advent of High Throughput Satellite (HTS) has been significant amount of new satellite capacity come online in recent years, prompting industry-wide disruptive innovation. This lower cost capacity enables a new era of satellite communications, with innovative new applications spreading around the world. However, there are a number of factors that must be considered for the operation of a successful HTS service. The satellite industry is undergoing a dramatic evolution as more and more High Throughput Satellite (HTS) capacity is introduced to markets around the world, like Intelsat Epic , Inmarsat Global Express , Viasat-2 , SES-12 ,etc. HTS is bringing more and lower-cost capacity that enables the satellite industry to cost-effectively provide large-scale internet services to rural and other hard-to-serve areas around the world. To enable these services, many providers are focusing on selecting the optimal ground system, and rightly so, because the ground system is a key e...