DEV Community

Cover image for Python - Simple and beautiful
No Name Pro
No Name Pro

Posted on • Originally published at


Python - Simple and beautiful

Hello ๐Ÿ‘‹

I want to show you, what Python works. How to write functions and if's.

I'm new in Python, i previous worked with C# and other languages which have a compiler.

Python don't needs a compiler. It's an script language. The good is, you can code everywhere and just need to run this file.

But if you code a error, for example Syntax-Error, the program neeeds to go to the line. A Compiler check this on compiling and will show it.

Define a variable

# Define a boolean
MyVariable = True

# Define a string
WelcomeText = "Welcome"

# Define a array
Names = ['Some', 'Body']

Print/Write to Console

# Print a defined text
print("I am at the Console!")

# Print a string

# Print a multiple Strings/Text
print(WelcomeText + ' User')


if MyVariable == True:
    # Do something


# Define a new function
def Welcome:

# Run Function

For Loops

for user in names:
    print(WelcomeText + ' ' + user)

So yeah ๐ŸŽ‰

Python is a beatiful language, what mean formatting.

I think it's easy to understand, and i would use Python for small scripts for Linux, Windows and macOS.

For more help, ask me or search in the world-wide-web.

Top comments (2)

stackneverflow profile image

First thanks for the interesting post. And a warm welcome to the community and python community (hopefully 3.X and not 2.7).

nonamepro0 profile image
No Name Pro

Thank you for your contribution. Well yes, I am using the latest version 3.8. ๐Ÿ˜Š

An Animated Guide to Node.js Event Loop

>> Check out this classic DEV post <<