Discover and read the best of Twitter Threads about #pythonlearning

Most recents (9)

2/n
Types of magic commands

Line magics - starts with % character. Rest of the line is its argument passed without parentheses or quotes.

Cell magics - %% - can operate on multiple lines below their call.
#DataScience #MachineLearning #100DaysOfMLCode #Python #DataScientist
Read 21 tweets
Our topic of today is a "PRINT FUNCTION" in python.

#SSOT #PYTHON #pythonlearning #Python #pythonprogramming #CyberSecurity #softwaredevelopment
In Python, the command print tells the program to display words or numbers on the screen. Here's a line of code that tells Python to display the words “Hello, World!”

print("Hello, World!")
print is a keyword—that is, a word that has special meaning for Python. It means, "Display what’s inside the parentheses." Note that print isn't capitalized. If you capitalize it, the program won’t run.
Read 9 tweets
Today we are going to talk about "DATA TYPES IN PYTHON"
Just follow the thread till the end.

#pythonprogramming #pythonlearning #SSOT #python
What is data type in python programming?

In python programming, a data type is an attribute of data which tells the compiler or interpreter how the programmer intends to use the data.
In python programming, data type is an important concept.

Variables can store data of different types, and different types can do different things.

Python has the following data types built-in by default, in these categories:
Read 12 tweets
Find the median and the quarts parts of a statistic sequence in #pythonprogramming: a thread
1/ First write an median function which find the half indice of a list using n = len(list) (lenght of list) means (n-1)/2 if n is odd and between n/2 - 1 and n/2 if n is even.
In this function, we particularly use % for design arithmetic rest and int operator to convert float to integer. NB: we suppose that at the beginning, list is range by increase order.
2/ Afterwards we define a new function using same logic, but in more take an list of notes,
create a new list knowing that value of first list list[i] design students number who have been the note i. And send the median of the new list.
Read 6 tweets
Hi Reader, I hope you are having a good day and will have a great life from now on.

Day 8 of #100DaysOfCode.

Python
Type 2 of itertools
remember you have to import them using
from itertools import name_of_itertool
1)takewhile
Take values from iterable while the predicate function remains true,once predicate function returns false it will no
longer take values.
example:
lis=[2,4,1,8,6,14]
lis_even=list(takewhile(lambda x:x % 2 == 0,lis))
returns lis_even=[2,4]
2)accumulate
Returns a running total of values in iterable.
lis=[0,1,2,3]
lis_new=list(accumulate(lis))
returns lis_new=[0,1,3,6]
Read 7 tweets
Good morning to you all. Just a quick note to let you know that I am the 67th Pythonista who cracked Bite 317. Pickling objects - on behalf of @pybites I Challenge You! codechalleng.es/bites/317 #Python #CodeChallenges
With almost every challenge, I learn something new. This time how to load (deserialize) and dump (serialize) a data structure from/to a pickle file which supports storing your own objects.
Needless to say, this requires additional practice to fully understand and apply independently.
But that's the whole idea behind learning something new and making it your own.
#learntocode #pythonlearning
Read 3 tweets
#Learn 🧠🐍#python: Sometimes when programming in python they're situations when you want to copy the contents of an existing list into another. Python has several ways of achieving that. In this thread you will learn different ways of achieving that with the help of examples. Image
1) Using the equal (=) sign operator:
Using = operator you can copy the contents of an existing list onto another/new list. But there's a problem with this method which I will explain on the next section. Image
The problem with the above method is that if you modify the new copied_fruits list the original list (fruits) is modified too, this is because the copied list (copied_fruits) is referencing/ pointing to same fruits list in memory.
Read 17 tweets
Hi Reader, I hope you are having a good day and will have a great life from now on.

Day 7 of #100DaysOfCode.

Python
1)Recursive Functions:
Every recursive function has a base case that stops it from going into the fourth dimension(that's what I like to think 😅).
Example 1: Image
Recursive functions can be implemented with more than one function. Here's an example for checking even and odd numbers
Example 2: Image
Read 8 tweets
Flask or Django?

Read thread...
If you've a bit of Python experience, yu know exactly what yu want, & its a fairly standard web application that involves displaying some content, storing some stuff in a database, having users register, & having administrators b able to control what's on the website: use Django.
If you are a Python beginner: use Flask.
Read 7 tweets

Related hashtags

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.00/month or $30.00/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!