Skip to main content

Real-Time Currency Converter (PCTS)

 Currency Converter





Currency Conversion is a basic real time need in today's life, whether it's exchange of currency while tourism or stock market, import and export duties, determine the selling and buying profits of different products around the world. So it can be referred to as one of the key elements in globalization.

Use of a Module:
Forex Module


Install the module into the computer first by running the following command in the Command Prompt: pip install forex-python

Copy the following code:


from forex_python.converter import CurrencyRates
curr = CurrencyRates()

print("""
Country with currency codes and currency names
Albania	ALL	lek
Algeria	DZD	dinar
Angola	AOA	kwanza
Argentina	ARS	peso
Armenia	AMD	dram
Australia	AUD	dollar
Austria	EUR	euro
Azerbaijan	AZN	manat
Bahrain	BHD	dinar
Barbados	BBD	dollar
Belarus	BYN	rouble
Belgium	EUR	euro
Bermuda	BMD	dollar
Bolivia	BOB	boliviano
Bosnia and Herzegovina	BAM	konvertibilna marka
Botswana	BWP	pula
Brazil	BRL	real
Bulgaria	BGN	lev
Cabo Verde	CVE	escudo
Cambodia	KHR	riel
Cameroon, Republic of	XAF	CFA franc BEAC
Canada	CAD	dollar
Cayman Islands	KYD	dollar
Chad	XAF	CFA franc BEAC
Chile	CLP	peso
China, People’s Republic of	CNY	yuan
Colombia	COP	peso
Congo, Democratic Republic of the	CDF	franc
Congo, Republic of	XAF	CFA franc BEAC
Costa Rica	CRC	colon
Croatia	HRK	kuna
Cyprus	EUR	euro
Czech Republic	CZK	koruna
Denmark	DKK	kroner
Dominican Republic	DOP	peso
Ecuador	USD	dollar
Egypt	EGP	pound
El Salvador	USD	dollar
Equatorial Guinea	XAF	CFA franc BEAC
Estonia	EUR	euro
Fiji	FJD	dollar
Finland	EUR	euro
France	EUR	euro
Gabon	XAF	CFA franc BEAC
Georgia	GEL	lari
Germany	EUR	euro
Ghana	GHS	cedi
Gibraltar	GIP	pound
Greece	EUR	euro
Greenland	DKK	Danish krone
Guatemala	GTQ	quetzal
Guernsey, Channel Islands	GBP	British pound sterling
Guyana	GYD	dollar
Honduras	HNL	lempira
Hong Kong SAR	HKD	dollar
Hungary	HUF	forint
Iceland	ISK	krona
India	INR	rupee
Indonesia	IDR	rupiah
Iraq	IQD	dinar
Ireland	EUR	euro
Isle of Man	IMP	pound
Israel	ILS	shekel
Italy	EUR	euro
Ivory Coast (Cote d'Ivoire)	XOF	CFA franc BCEAO
Jamaica	JMD	dollar
Japan	JPY	yen
Jersey, Channel Islands	GBP	British pound sterling
Jordan	JOD	dinar
Kazakhstan	KZT	tenge
Kenya	KES	shilling
Korea, Republic of	KRW	won
Kosovo	EUR	euro
Kuwait	KWD	dinar
Kyrgyzstan	KGS	som
Lao PDR	LAK	kip
Latvia	EUR	euro
Lebanon	LBP	pound
Libya	LYD	dinar
Liechtenstein	CHF	franc
Lithuania	EUR	euro
Luxembourg	EUR	euro
Macau SAR	MOP	pataca
Madagascar	MGA	ariary
Malawi	MWK	kwacha
Malaysia	MYR	ringgit
Maldives	MVR	rufiyaa
Malta	EUR	euro
Mauritania	MRU	ouguiya
Mauritius	MUR	rupee
Mexico	MXN	peso
Moldova	MDL	leu
Mongolia	MNT	tugrik
Montenegro	EUR	euro
Morocco	MAD	dirham
Mozambique	MZN	metical
Myanmar	MMK	kyat
Namibia, Republic of	NAD	dollar
Netherlands	EUR	euro
New Zealand	NZD	dollar
Nicaragua	NIO	cordoba oro
Nigeria	NGN	naira
North Macedonia	MKD	denar
Norway	NOK	kroner
Oman	OMR	rial
Pakistan	PKR	rupee
Palestinian territories	ILS, USD, and JOD	shekel, dollar, and dinar
Panama	PAB  and USD	balboa  and dollar
Papua New Guinea	PGK	kina
Paraguay	PYG	guarani
Peru	PEN	nuevo sol
Philippines	PHP	peso
Poland	PLN	zloty
Portugal	EUR	euro
Puerto Rico	USD	dollar
Qatar	QAR	riyal
Romania	RON	leu
Russian Federation	RUB	ruble
Rwanda	RWF	franc
Saint Lucia	XCD	dollar
Saudi Arabia	SAR	riyal
Senegal	XOF	CFA franc BCEAO
Serbia	RSD	dinar
Singapore	SGD	dollar
Slovak Republic	EUR	euro
Slovenia	EUR	euro
South Africa	ZAR	rand
Spain	EUR	euro
Sri Lanka	LKR	rupee
Swaziland	SZL	lilangeni
Sweden	SEK	krona
Switzerland	CHF	franc
Taiwan	TWD	dollar
Tajikistan	TJS	somoni
Tanzania	TZS	shilling
Thailand	THB	baht
Timor-Leste	USD	US dollar
Trinidad And Tobago	TTD	dollar
Tunisia	TND	dinar
Turkey	TRY	lira
Turkmenistan	TMT	manat
Uganda	UGX	shilling
Ukraine	UAH	hryvnia
United Arab Emirates	AED	dirham
United Kingdom	GBP	sterling
United States	USD	dollar
Uruguay	UYU	peso
Uzbekistan, Republic of	UZS	sum
Venezuela	VEF	bolivar
Vietnam	VND	dong
Zambia	ZMW	kwacha
Zimbabwe	ZWD	dollar
""")
amnt = int(input("Enter the amount: "))
ini_cur = input("Enter the currency code from which you want to convert:").upper()
fin_cur = input("Enter the currency code into which you want to convert:").upper()


print("Converting ",amnt,ini_cur,"to ",fin_cur)
result = curr.convert(ini_cur,fin_cur,amnt)
print(result)

©SGPython

Comments

Popular posts from this blog

Our view towards Python (as a programming language)

  Python - The language of the future Introduction When we hear the term programming language, we usually talk about high-level programming language which are those programming language having a lucid (or easy-to-read) syntax and are later converted to low-level language (binary) , which is understandable by the computer.  Programming language has always been an area of interest over the passing years since the very early days of ' Fortran ' (created by John Backus at  IBM ). To this day, dozens of programming language has been created by different 'Computer Scientists' around the world. What is Python? What is Python? Many of you will describe a large scary snake 🐍, which isn't actually wrong 😅. But here we are talking about a programming language. Similarly, Python is also a high-level and interepreted programming language created by  Guido van Rossum in the late 1980s . It was first released in 1991 as a successor to ABC Programming language . It known fo...

For Loops

 The for loop By  polygraphus  on  shutterstock Def: The for loop is also known as the counting loop and is designed to process the items of any sequence, such as a list or a string, one by one. General form of for loop: The general form of the for loop is given below:      for <variable> in <sequence>:          statements to repeat

Type-Casting And Dynamic-Typing

Python is equipped with some of the amazing and easy to use methods which are already built-in keeping the ease of understanding and fun-to-learn. Some of these amazing properties are going to be discussed today in the blog. Type-Casting Typecasting is one of the simple topics of Python which which is very much easy to understand yet is very efficient in the day-to-day lives of Python programmers. Def:  The explicit conversion of an operand to a specific type is called  typecasting. Explicit conversion refers to the type of conversion of datatype into which the user wants to change his or her expression into. Note that these types of conversion are user defined. Typecasting in Python can be explained as follows:                         <datatype> (expression) where <datatype> refers to the datatype into which the user wants to type-cast. Example:  When we use input() function, Python alwa...