Try some interesting Python codes

Hello readers !!

In this write-up, I am just sharing some basic code snippets with you. You can try these in your free time.

🌈Print Emojis Using Python

print("\U0001F917")

OUTPUT - 🤗

print("\U0001F637")

OUTPUT - 😷

print("\U0001F62A")

OUTPUT - 😪

print("\U0001F618")

OUTPUT - 😘


🌈Get Phone number details using Python

pip install phonenumbers
import phonenumbers
from phonenumbers import carrier, geocoder, timezone

mobileNo=input("Enter Mobile Number with Country code: ")

mobileNo = phonenumbers.parse(mobileNo) 

# get timezone a phone number 
print(timezone.time_zones_for_number(mobileNo))

# Getting carrier of a phone number
print(carrier.name_for_number(mobileNo, "en"))

# Getting region information
print (geocoder.description_for_number(mobileNo, "en"))

# Validating a phone number

print("Valid Mobile Number:",phonenumbers.is_valid_number(mobileNo))

# Checking possibility of a number

print("Checking possibility of Number:", phonenumbers.is_possible_number(mobileNo))

OUTPUT

output.png


🌈Shutdown PC using Python

import os
os.system("Shutdown /s /t 1")

🌈Internet Speed Test using python in Kbps

pip install speedtest-cli
from speedtest import Speedtest
st = Speedtest()
print(" Download Speed of your connection is: ", st.download())
print(" Upload Speed of your connection is: ", st.upload())

Thanks for having a look at this article. Hope you enjoyed these codes 🤗.