Aditya Tiwari Profile picture
Nov 16, 2021 8 tweets 4 min read Read on X
Python's Math module has many powerful commands that allows you to perform many mathematical tasks easily.

#Python #AI #MachineLearning
#100DaysOfCode #DataScience
Let's have a look at some of them 🧵 ↓
1. math.sqrt is used to return the square root of a number.

Example 👇
2. math.fabs() is used to return the absolute value of a number.

Example 👇
3. math.pow() is used to return base raised to exp power.

Example 👇
4. There are some trigonometric functions too , math.sin() , math.cos() and math.tan() return the values of their arguments.

Example 👇
5. Math.degrees is used to convert an angle from radians to degrees.

Example 👇
6. math.radians is used to convert an angle from degrees to radians.

Example 👇
Thankyou for reading the thread.

I hope you got something to learn from this thread. Make sure to give it a retweet for your audience to enjoy as well.

Also , follow me if you are interested in #Python #webdevelopment #javascript

@TheGeekyB0y

• • •

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

Keep Current with Aditya Tiwari

Aditya Tiwari 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 @TheGeekyB0y

Mar 2, 2023
Inheritance in Python

It is a way of creating a new class by deriving it from an existing class.

With inheritance, the new class inherits all properties and behaviors of the existing class, allowing to reuse code and create classes that build on each other

A thread🧵
#Python
In Python, we can define a class that inherits from another class using the syntax class DerivedClass(BaseClass):

This means that the DerivedClass is inheriting from the BaseClass.

1/10
Here is an example of how to define a class that inherits from another class:

In this example, we have a Animal class with a speak method that prints "I am an animal". We also have a Dog class that inherits from Animal and adds a bark method that prints "Woof!".

2/10
Read 13 tweets
Feb 28, 2023
Objects and Classes in Python🐍

Objects are instances of a class, and classes are the blueprint for creating objects.

In this thread🧵, we'll explore the concepts of objects and classes in depth, along with some examples.

#Python Image
First, let's define a class in Python.

To create a class, we use the class keyword followed by the name of the class. Here's a simple example:

In this example, we've created a class called MyClass with nothing inside it. Let's add some attributes to the class.

1/10 Image
Attributes are variables that belong to a class. They are defined in the __init__ method of the class. Here's an example:

In this example, we've defined a class : Person with two attributes: name and age. The __init__ method is called when a new instance of the class is created. Image
Read 14 tweets
Feb 22, 2023
Strings and String Manipulation Methods in Python🐍

Strings in Python are a sequence of characters enclosed in single, double, or triple quotes.

Strings are immutable, which means you cannot change their values after they are created.

Detailed Thread👀🧵

#python #programming
Concatenation of Strings : You can concatenate two or more strings using the "+" operator.

1/16
Replication of Strings : You can also repeat a string multiple times using the "*" operator.

2/16
Read 18 tweets
Feb 21, 2023
Loops in Python ⚡🐍

Loops are an essential programming concept that allow you to execute a block of code repeatedly. There are two main types of loops in Python: for loops and while loops.

A thread 🧵#python #DataScience
For Loop :

A for loop allows you to iterate over a sequence of values, such as a list, tuple, or string.

Here's an example that prints each element of a lists

1/10
You can also use the range() function to iterate over a sequence of numbers. Here's an example that prints the numbers 0 through 9:

2/10
Read 17 tweets
Feb 20, 2023
F-strings in Python : The ultimate usage tips ⚡

F-strings in Python are a concise and powerful way to format strings. You can include any valid Python expression inside the curly braces in an f-string.

Thread 🧵

#Python #programming Image
To use an f-string, just prefix your string with the letter "f".

Here's an example that uses an f-string to format a variable:

#Python
1/16 Image
You can use f-strings to format numbers as well. Here's an example that formats a floating-point number with two decimal places:

2/16 #Python Image
Read 18 tweets
Jan 27, 2023
Internet is full of resources. Its good, but sometimes, people get stuck on which is best for them.

I have compiled a massive list of resources for PYTHON lang you can get started with.

#Python

A thread 🧵
Official SitePython.org
Documentation : docs.python.org/3/
Quick Start Guide : python.org/about/gettings…

#Python

1/9
Basic Roadmap (GFG)
geeksforgeeks.org/best-way-to-st…

Python Notes (goalkicker)
books.goalkicker.com/PythonBook/

#Python

2/9
Read 11 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

Don't want to be a Premium member but still want to support us?

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

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(