<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rahul Gupta</title>
    <description>The latest articles on DEV Community by Rahul Gupta (@rahulgtst).</description>
    <link>https://dev.to/rahulgtst</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F962384%2Fb43898fd-6265-474c-a704-a44bae123957.jpg</url>
      <title>DEV Community: Rahul Gupta</title>
      <link>https://dev.to/rahulgtst</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rahulgtst"/>
    <language>en</language>
    <item>
      <title>Strings Formatting in Python</title>
      <dc:creator>Rahul Gupta</dc:creator>
      <pubDate>Tue, 03 Jan 2023 11:54:49 +0000</pubDate>
      <link>https://dev.to/rahulgtst/strings-formatting-in-python-h00</link>
      <guid>https://dev.to/rahulgtst/strings-formatting-in-python-h00</guid>
      <description>&lt;p&gt;String formatting is the process of infusing things in the string dynamically and presenting the string.&lt;/p&gt;

&lt;p&gt;There are 3 different methods to format a string in string&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Old style formatting&lt;/li&gt;
&lt;li&gt;String Format method&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;F-string / String interpolation&lt;/p&gt;
&lt;h2&gt;
  
  
  Old style formatting technique
&lt;/h2&gt;

&lt;p&gt;In this technique we need percent symbol &lt;code&gt;%&lt;/code&gt; followed by some characters inside the string as placeholder for the values that will be embedded in string.&lt;br&gt;
There are four placeholder or special symbols:&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;%s&lt;/code&gt; → string&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;%d&lt;/code&gt; → integer&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;%f&lt;/code&gt; → float&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;%.(n)f&lt;/code&gt; → for floating value with n digit precision (n is a positive integer)&lt;br&gt;
These symbols are similar that use in c programming language.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example 1:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a=5
b=3
print(‘%d + %d = %d’%(a,b,a+b))
# 5+ 3 = 8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example 2:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name= ‘Anuj’
like=’Bikes’
print(‘My name is %s. I like %s’%(name,like))
# My name is Anuj. I like Bikes.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  String format Method
&lt;/h2&gt;

&lt;p&gt;In this technique we use string format method. To use format method we need to use pair of empty curly bracket &lt;code&gt;{}&lt;/code&gt; for each variable we need to embed in the string at place of brackets&lt;/p&gt;

&lt;p&gt;Example 1:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a=5
b=3
print(‘{} + {} = {}’.format(a,b,a+b))
# 5+ 3 = 8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example 2:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name= ‘Anuj’
like=’Bikes’
print(‘My name is {}. I like {}.’.format(name,like))
# My name is Anuj. I like Bikes.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  F-string / Literal string interpolation
&lt;/h2&gt;

&lt;p&gt;To create an f-string, prefix the string with the letter “ f ”. The string itself can be formatted in much the same way that you would with str.format().&lt;/p&gt;

&lt;p&gt;Example 1:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a=5
b=3
print(f.‘{a} + {b} = {a+b}’)
# 5+ 3 = 8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example 2:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name= ‘Anuj’
like=’Bikes’
print(f.‘My name is {name}. I like {like}’)
# My name is Anuj. I like Bikes.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you like my post consider following me I am sharing content on programming and development. Please comment any improvement on this post.&lt;br&gt;
You can contact me on-&lt;br&gt;
&lt;code&gt;Linkedin: https://www.linkedin.com/in/rhlgt/&lt;br&gt;
Twitter: https://twitter.com/rahulgtst&lt;/code&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>programming</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Best choices of programming languages for a beginner⭐</title>
      <dc:creator>Rahul Gupta</dc:creator>
      <pubDate>Wed, 28 Dec 2022 15:03:23 +0000</pubDate>
      <link>https://dev.to/rahulgtst/best-choices-of-programming-languages-for-a-beginner-139c</link>
      <guid>https://dev.to/rahulgtst/best-choices-of-programming-languages-for-a-beginner-139c</guid>
      <description>&lt;p&gt;A programming language is required if you wish to work in the computer industry. If you are unsure about which programming language to use, I have included some beginner-friendly programming languages below.&lt;/p&gt;

&lt;p&gt;Note: Learning and mastering one language is the ideal option for beginners.&lt;/p&gt;

&lt;h2&gt;
  
  
  C++
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_uvpvPIb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hmauwnrs4kx61gmlib1a.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_uvpvPIb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hmauwnrs4kx61gmlib1a.jpg" alt="c++" width="880" height="229"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;C++ is a cross-platform language that can create high-performance applications. C++ was developed by Bjarne Stroustrup, as an extension to the C language.&lt;/p&gt;

&lt;p&gt;Advantages-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It gives programmers a high level of control over system resources and memory.&lt;/li&gt;
&lt;li&gt;It can be found in today's operating systems, Graphical User Interfaces, and embedded systems.&lt;/li&gt;
&lt;li&gt;It is an object-oriented programming language that gives a clear structure to programs and allows code to be reused, lowering development costs.&lt;/li&gt;
&lt;li&gt;It is portable and can be used to develop applications that can be adapted to multiple platforms.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Python
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8Gk_19U6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yyhlvycd2ldxt35bnci4.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8Gk_19U6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yyhlvycd2ldxt35bnci4.jpg" alt="python" width="880" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Python is a popular programming language. It was created by Guido van Rossum, and released in 1991.&lt;/p&gt;

&lt;p&gt;Advantages-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It has a simple syntax similar to the English language.&lt;/li&gt;
&lt;li&gt;Its syntax allows developers to write programs with fewer lines than some other programming languages.&lt;/li&gt;
&lt;li&gt;It can be used on a server to create web applications.&lt;/li&gt;
&lt;li&gt;It can be used alongside software to create workflows.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Java
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--m8aHKPpa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uz9cn0h13cfuv00b7v6s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--m8aHKPpa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uz9cn0h13cfuv00b7v6s.png" alt="java" width="880" height="285"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Java is a popular programming language, created in 1995. It is owned by Oracle, and more than 3 billion devices run Java.&lt;/p&gt;

&lt;p&gt;Advantages-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It has a large demand in the current job market&lt;/li&gt;
&lt;li&gt;It is easy to learn and simple to use&lt;/li&gt;
&lt;li&gt;It has huge community support (tens of millions of developers)&lt;/li&gt;
&lt;li&gt;It's used for various purposes like mobile applications development, desktop application development, and many others.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  JavaScript
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--voc3DiQo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vlpikjtb0ohz3ydt1uxg.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--voc3DiQo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vlpikjtb0ohz3ydt1uxg.jpg" alt="Javascript" width="880" height="275"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;JavaScript is the world's most popular programming language. JavaScript is the programming language of the Web.&lt;/p&gt;

&lt;p&gt;Advantages-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It is a simple and easy-to-use programming language.&lt;/li&gt;
&lt;li&gt;It is one of the world's most popular programming languages.&lt;/li&gt;
&lt;li&gt;It is used by many famous companies.&lt;/li&gt;
&lt;li&gt;It is a versatile language that can be used for front-end as well as back-end development.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you like my post consider following me I am sharing content on programming and development also you can like or comment on this post.&lt;/p&gt;

&lt;p&gt;You can contact me on-&lt;br&gt;
&lt;a href="https://www.linkedin.com/in/rhlgt/"&gt;LinkedIn&lt;/a&gt;&lt;br&gt;
&lt;a href="https://twitter.com/rahulgtst"&gt;Twitter&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>computerscience</category>
    </item>
  </channel>
</rss>
