Logo

dev-resources.site

for different kinds of informations.

Day 5: Writing our first program in python with home🧡work

Published at
7/19/2024
Categories
python
100daysofcode
coding
computer
Author
aryan015
Author
8 person written this
aryan015
open
Day 5: Writing our first program in python with home🧡work

index
In this blog we will cover to take input and print it on the display.

input and output in python

You can take input from the user using input function. Remember input function implicit convert input to string. If you enter number then you cannot perform operations on it.

# you can pass string param to input to display 🧡
import datetime # inbuilt module to play with dates in py
today = datetime.date.today() # datetime.date(2024, 7, 19)
current_year = today.year # 2024
print(current_year)  # This will display the current year (e.g., 2024)
# int converts string to int
DOB = int(input('Enter you age')) # 1998
# calculate your age
print(current_year - DOB) # 26
Enter fullscreen mode Exit fullscreen mode

Thank you

computer Article's
30 articles in total
Favicon
The Evolution of Technology
Favicon
11 Essential Non-Coding Skills Every Developer Needs to Master
Favicon
The Transformative Power of Technology: Shaping the Present and Future
Favicon
5 Reasons AIO Gen 9 Computer is Ideal for Home and Office Use
Favicon
How to Choose the Right CPU for Your Desktop Computer
Favicon
Beginner-Friendly Basic Computer Course Overview
Favicon
Lenovo Distributor in Dubai Offers Reliable Solutions for Modern Businesses
Favicon
Boost Your AWS Backup in 5 Minutes: Automate EBS Snapshots with CloudWatch
Favicon
Master Git in 30 Minutes: Unlock Essential Terms and Commands for Efficient Collaboration
Favicon
How to Remove Malware from Your Computer
Favicon
Computer Teacher Interview Tips
Favicon
Demystifying Software-Defined Networking (SDN): Simplifying Network Management
Favicon
Day 5: Writing our first program in python with home🧡work
Favicon
What Every Cyber Specialist Needs to Know About Computer Structure
Favicon
Did you know?
Favicon
Make Your Events Unforgettable with be Matrix LED Tile Rental Indianapolis.
Favicon
Enhance Your Workflow with DeskTrack’s Productivity Monitoring Software
Favicon
O que é uma Memória RAM ECC? Para que serve e quando usar?
Favicon
Kompyuter nima va U Qanday ishlaydi ?
Favicon
Cuando la tecnología aporta... ¿confusión?
Favicon
ij.start.canon/connect
Favicon
Troubleshooting Guide: Why Your Keyboard Isn't Working and How to Fix It
Favicon
Exploring the Advantages of Operating Systems
Favicon
Navigating the Digital Maze: A PCValley Journey in Computer Repair
Favicon
Basic Computer
Favicon
Unlocking the Future of Healthcare: A Computer Assisted Coding Demo
Favicon
Panoramic Infotech
Favicon
Building a Self-Driving Car in Atari 2600 Grand Prix Game – Full tutorial
Favicon
WHAT SPECS DO I NEED IN A WEB DEV PC?
Favicon
Access your computer's files from your phone

Featured ones: