Are you interested in learning Python?

A thread on Python's basic syntax 🧵

P/S: If you liked this thread, please retweet.
VARIABLES
- Variable names are case sensitive (name and NAME are
different variables)
- Must start with a letter or an underscore
- Can have numbers but must not start with one
- Python is loosely-typed (you don’t specify the type when
declaring a variable.
FUNCTIONS

- In python, functions are defined with the def keyword.
- Indentation is used instead of curly braces.
- A colon is placed after the parameters.
- No semi-colons.
STRINGS

- Strings in python are surrounded by either single or double quotation marks
- F-Strings enable you easily concatenate two different types without having to cast it first
TUPLES

- These are data collections which are ordered, unchangeable and can have duplicate members.
SETS

- These are data collections which are unordered and doesn’t allow duplicate members
DICTIONARY

- These are data collections which are unordered, changeable and indexed. Similar syntax to objects in Javascript.
LOOPS

- Loops are mechanisms for iterating over a list of items while performing a consistent action on each of them
CONDITIONALS

- If/else expressions are used to execute a set of instructions based on whether a statement is true or false.
MODULES

- A module is a file containing a set of functions to include in your application. There are core python modules which are part of the Python environment, modules you can install using the pip package manager as well as custom modules
CLASSES.
A class is like a blueprint for creating objects. An object has properties and methods associated with it.

- Like with functions, all fields inside a class must be indented.
- Use def keyword to define a method
- self keyword is used to refer to the current class.
To learn more, read the full article:

dev.to/ubahthebuilder…

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Kingsley Ubah 🌟

Kingsley Ubah 🌟 Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @UbahTheBuilder

19 Dec 20
🌟 A thread of tips, lessons, gotchas, syntactical conventions, semantics, structures and common errors regarding JavaScript.

Follow to be enlightened!

#100DaysofCode
#Javascript
#CodeNewbies
🌟 1: All programming languages works with data, and there are 7 built in data types in #JavaScript:

• null
• undefined
• boolean
• number
• string
• object
• symbol—added in ES6!

They are also called primitive types

#100DaysOfCode
#CodeNewbies
🌟 2: #null essentially means "no data", empty, nada. #undefined means data has not been explicitly defined or declared. #boolean evaluates to either true or false. #numbers are digits between 0-9, #strings are characters enclosed within double quotes

#100DaysOfCode
#CodeNewbie
Read 32 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!