<?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: sonozig</title>
    <description>The latest articles on DEV Community by sonozig (@sonozig).</description>
    <link>https://dev.to/sonozig</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F867921%2Fbcfd706a-35ee-4d57-8df5-dd47946046b8.jpg</url>
      <title>DEV Community: sonozig</title>
      <link>https://dev.to/sonozig</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sonozig"/>
    <language>en</language>
    <item>
      <title>Give me ideas</title>
      <dc:creator>sonozig</dc:creator>
      <pubDate>Thu, 02 Jun 2022 19:18:31 +0000</pubDate>
      <link>https://dev.to/sonozig/give-me-ideas-4nnp</link>
      <guid>https://dev.to/sonozig/give-me-ideas-4nnp</guid>
      <description>&lt;p&gt;Give me ideas of games I can create using Unreal Engine 5.&lt;/p&gt;

</description>
      <category>gamedev</category>
    </item>
    <item>
      <title>All you need to know about IF statements</title>
      <dc:creator>sonozig</dc:creator>
      <pubDate>Thu, 26 May 2022 21:37:22 +0000</pubDate>
      <link>https://dev.to/sonozig/all-you-need-to-know-about-if-statements-1nh7</link>
      <guid>https://dev.to/sonozig/all-you-need-to-know-about-if-statements-1nh7</guid>
      <description>&lt;p&gt;You may be thinking: I already know how to use IF statements in Python.&lt;br&gt;
Yes, you do.&lt;br&gt;
So, why am I writing this?&lt;br&gt;
Well, if you have just started learning Python, or if you have never used it before, here are some tips that may help you:&lt;/p&gt;

&lt;p&gt;If you want to test if a variable is True or False, you can just do this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;variable1 = True
variable2 = False

if variable1:
   print("The first variable is True")

if not variable2:
   print("The second variable is False")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can do the same thing to test if there is a value assigned to the variable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;variable1 = "Some text"
variable2 = 1
variable3 = ""

if variable1:
   print("The first variable has a value assigned to it")

if variable2:
   print("The second variable has a value assigned to it")

if not variable3:
   print("The third variable has not a value assigned to it")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To check if a value is inside a list, use this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;numbers = ["one", "two", "three", "four", "five"]

if "four" in numbers:
   print("The number four is in the list")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remember: "one" is numbers[0], not numbers[1]. This last one is "two".&lt;/p&gt;

&lt;p&gt;Atention: to check if a value is equal to another, you can't use the examples above. Use &lt;code&gt;x == y&lt;/code&gt;.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
    </item>
    <item>
      <title>LocalServer</title>
      <dc:creator>sonozig</dc:creator>
      <pubDate>Thu, 26 May 2022 12:52:30 +0000</pubDate>
      <link>https://dev.to/sonozig/localserver-9m5</link>
      <guid>https://dev.to/sonozig/localserver-9m5</guid>
      <description>&lt;p&gt;Hi!&lt;br&gt;
I'm working on a project that will be very useful for many others.&lt;br&gt;
When I was learning Python, I created a program that creates an account for the user.&lt;br&gt;
It had two variables: username and password.&lt;br&gt;
But every time I ran the program, the values of both variables weren't the same.&lt;br&gt;
So, I'm creating this project, that will sove the problem.&lt;br&gt;
The idea is to create a text file that will work as a server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def CreateFile(name):
  try:
    with open(f"{name}.txt", "a+"):
      return 0
  except:
    pass

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code will create a text file.&lt;br&gt;
The next time you run the your code, it'll check if the file already exists.&lt;br&gt;
If it does, nothing will happen.&lt;br&gt;
To add informations to the file you can call the function Write():&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def Write(name, value):
  with open(f"{name}.txt", "a") as file:
    file.write(f"[INFO]:{value}]")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you may have noticed, the text file that you want to acess is a string, not a variable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# this is TestFile.py
import LocalServer

# creates a text file named MyFile
LocalServer.CreateFile("MyFile")

# adds Hello, World! to MyFile.txt
LocalServer.Write("MyFile", "Hello, World!")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can test if some text is in your text file or add settings to it.&lt;br&gt;
I'll keep working on this project so that it'll  be complete.&lt;/p&gt;

</description>
      <category>python</category>
    </item>
  </channel>
</rss>
