How to Convert tuple to float value in python - Handy Hack
1 comment
:
Posted by:
Handy Hack
at
April 30, 2020
Tags:
float
,
handy hack
,
program
,
python
,
tuple
Many times, When we working with tuple, we have faced a problem in which we need to convert a tuple to floating point number. In a tuple first element represents integer part and next element represents a decimal part. Now the problem is - How to Convert tuple to float value? Let's discuss the creation way-
Main Method: Using join() + float() + str() + generator expression
Using this method we just convert first tuple element into a string, and then join them and convert them to desire integer.
Source Code:
# Convert tuple to float
# using join() + float() + str() + generator expression
#initialize tuple
tuple = (9,12)
#printing original tuple
print("The original tuple: " + str(tuple))
# Convert tuple to float
# using join() + float() + str() + generator expression
var = float(' . ' . join(str(ele) for ele in tuple))
#print result
print("The float number after conversion from tuple is : " + str(var))
Output:
The original tuple: (9,12)
The float number after conversion from tuple is : 9.12
Note:
1. Concatenate a list of strings into one string: join()
2. Concatenate a list of numbers into one string: join(), str()
Main Method: Using join() + float() + str() + generator expression
Using this method we just convert first tuple element into a string, and then join them and convert them to desire integer.
Source Code:
# Convert tuple to float
# using join() + float() + str() + generator expression
#initialize tuple
tuple = (9,12)
#printing original tuple
print("The original tuple: " + str(tuple))
# Convert tuple to float
# using join() + float() + str() + generator expression
var = float(' . ' . join(str(ele) for ele in tuple))
#print result
print("The float number after conversion from tuple is : " + str(var))
Output:
The original tuple: (9,12)
The float number after conversion from tuple is : 9.12
Note:
1. Concatenate a list of strings into one string: join()
2. Concatenate a list of numbers into one string: join(), str()
Top 10 keyboard shortcut keys everyone should know
No comments
:
Posted by:
Handy Hack
at
April 29, 2020
Tags:
Computer
,
copy
,
drag and drop
,
handy hack
,
keyboard
,
keys
,
paste
,
shortcut
,
Top 10
,
Windows 10
Did you know that using the keyboard shortcut key increases your work efficiency and save your time. So, most of the time you can use the shortcut key for your daily task on your computer. For example, you want to copy any media like songs, videos from one folder to another. Using mouse you can do, you have to right click of the mouse and choose the 'copy' option and 'paste' it in another folder. For that only you can use the keyboard shortcut key instead of mouse clicked. You have to use the Ctrl+C for copy and Ctrl+V for paste which is better than drag and drop.
Top 10 keyboard shortcut keys are given below.
Some additional keyboard shortcut keys are given below
Top 10 keyboard shortcut keys are given below.
Shortcut Keys
|
Description
|
Ctrl+C
|
It will copy the selected item
|
Ctrl+X
|
If you want to cut instead of copy the selected item
|
Ctrl+V
|
It will paste the item that stores in clipboard
|
Ctrl+A
|
Select all items on the current page
|
Ctrl+Z
|
It will undo any changes
|
Ctrl+Y
|
It will redo the undo
|
Ctrl+S
|
It saves the current task while working on any document or another file
|
F2
|
Rename a selected file
|
Alt+Enter
|
Open the properties for the selected item
|
Alt+F4
|
Close the currently active program
|
Some additional keyboard shortcut keys are given below
window+M
|
Minimize all windows
|
window+Shift+M
|
Restore the minimized windows
|
window+[Number]
|
Opens app pinned in [Number] position on taskbar
|
window+Tab
|
Open the task view
|
window+E
|
Open the file explorer
|
F5
|
Refresh the active window
|
Ctrl+Tab
|
Move forword through tabs for multitasking
|
Crtl+N
|
Open new window in any app
|
Crtl+W
|
Close open window
|
Alt+Tab
|
Switch between multiple app
|
Esc
|
Cancel the current task
|
Note: Here window refers to windows key
How to Connect Computer With Other Networks Through the Gateway
1 comment
:
Posted by:
Handy Hack
at
April 27, 2020
Tags:
Ad-Hoc
,
Computer
,
Gateway
,
handy hack
,
Internet
,
Network
,
TCP/IP
Gateways are Used to Connect Different Networks together Such as TCP/IP and DEC net. A gateway is a network node that connects the networks using different protocols together. While a bridge is used to join two similar types of networks, a gateway is used to join two dissimilar networks.
Now Question is What is Gateway?
A gateway is piece of Networking Hardware used in Telecommunications via Communications Networks that allows data flow from one discrete Network to another.
Now We Connect a Laptop to the Internet Through Another Computer
1. Connect the other Computer to the Ethernet Network. Click Start--> Control Panel--> View Networks Status and tasks-->Set Up a New Connection or Network.
2. Select Set Up a Wireless Ad Hoc(Computer to Computer) Network from the menu.
Click Next-->Next, again.
3. Create a name for the Network. For Security, select WPA2-Personal from the Security Type drop- down menu.
4. Create a Password for the Network. Select Save This Network to use in the future. Click Next and then Finish.
5. Return to Network and Sharing Center. Click Manage Wireless Networks. Right Click the Ad-Hoc network.
6. Select Properties from the context menu. Select the Sharing tab and then Allow Other Network Users to Connect Through This Computer's Internet Connection.
Now Question is What is Gateway?
A gateway is piece of Networking Hardware used in Telecommunications via Communications Networks that allows data flow from one discrete Network to another.
Now We Connect a Laptop to the Internet Through Another Computer
1. Connect the other Computer to the Ethernet Network. Click Start--> Control Panel--> View Networks Status and tasks-->Set Up a New Connection or Network.
2. Select Set Up a Wireless Ad Hoc(Computer to Computer) Network from the menu.
Click Next-->Next, again.
3. Create a name for the Network. For Security, select WPA2-Personal from the Security Type drop- down menu.
4. Create a Password for the Network. Select Save This Network to use in the future. Click Next and then Finish.
5. Return to Network and Sharing Center. Click Manage Wireless Networks. Right Click the Ad-Hoc network.
6. Select Properties from the context menu. Select the Sharing tab and then Allow Other Network Users to Connect Through This Computer's Internet Connection.
7. Sign on to the Laptop. Select the Wireless Network Connection icon from the notification area.
8. Choose the Ad-Hoc network from the list and then Click Connect. Enter the Password and then press Enter to connect to the Internet via the other PC.
How to find your Computer Serial Number in Windows 10
1 comment
:
Posted by:
Handy Hack
at
April 26, 2020
Tags:
bios
,
Command Prompt
,
Computer
,
handy hack
,
Serial Number
,
Windows 10
Hello,
It's very easy to find your Computer Serial Number. Just follow my steps.
1. Type cmd on search bar and you saw the Command Prompt, then click Run as administrator.
2. Type the Command: wmic bios get serialnumber, then press Enter
3. If your Serial Number is coded into your Bios it will appear on the screen
It's very easy to find your Computer Serial Number. Just follow my steps.
1. Type cmd on search bar and you saw the Command Prompt, then click Run as administrator.
2. Type the Command: wmic bios get serialnumber, then press Enter
3. If your Serial Number is coded into your Bios it will appear on the screen
Subscribe to:
Posts
(
Atom
)