Python program to print Emojis - GeeksforGeeks

文章推薦指數: 80 %
投票人數:10人

Every emoji has a Unicode associated with it. Emojis also have a CLDR short name, which can also be used. From the list of unicodes, replace “+” ... Skiptocontent TutorialsPracticeDS&Algo.DSATopic-wiseDSACompany-wiseAlgorithmsAnalysisofAlgorithmsAsymptoticAnalysisWorst,AverageandBestCasesAsymptoticNotationsLittleoandlittleomeganotationsLowerandUpperBoundTheoryAnalysisofLoopsSolvingRecurrencesAmortizedAnalysisWhatdoes'SpaceComplexity'mean?Pseudo-polynomialAlgorithmsPolynomialTimeApproximationSchemeATimeComplexityQuestionSearchingAlgorithmsSortingAlgorithmsGraphAlgorithmsPatternSearchingGeometricAlgorithmsMathematicalBitwiseAlgorithmsRandomizedAlgorithmsGreedyAlgorithmsDynamicProgrammingDivideandConquerBacktrackingBranchandBoundAllAlgorithmsDataStructuresArraysLinkedListStackQueueBinaryTreeBinarySearchTreeHeapHashingGraphAdvancedDataStructureMatrixStringsAllDataStructuresInterviewCornerCompanyPreparationTopTopicsPracticeCompanyQuestionsInterviewExperiencesExperiencedInterviewsInternshipInterviewsCompetititveProgrammingDesignPatternsSystemDesignTutorialMultipleChoiceQuizzesLanguagesCC++JavaPythonC#JavaScriptjQuerySQLPHPScalaPerlGoLanguageHTMLCSSKotlinCSSubjectsMathematicsOperatingSystemDBMSComputerNetworksComputerOrganizationandArchitectureTheoryofComputationCompilerDesignDigitalLogicSoftwareEngineeringGATEGATEComputerScienceNotesLastMinuteNotesGATECSSolvedPapersGATECSOriginalPapersandOfficialKeysGATE2021DatesGATECS2021SyllabusImportantTopicsforGATECSWebTechnologiesHTMLCSSJavaScriptAngularJSReactJSNodeJSBootstrapjQueryPHPSoftwareDesignsSoftwareDesignPatternsSystemDesignTutorialSchoolLearningSchoolProgrammingMathematicsNumberSystemAlgebraTrigonometryStatisticsProbabilityGeometryMensurationCalculusMathsNotes(Class8-12)Class8NotesClass9NotesClass10NotesClass11NotesClass12NotesNCERTSolutionsClass8MathsSolutionClass9MathsSolutionClass10MathsSolutionClass11MathsSolutionClass12MathsSolutionRDSharmaSolutionsClass8MathsSolutionClass9MathsSolutionClass10MathsSolutionClass11MathsSolutionClass12MathsSolutionPhysicsNotes(Class8-11)Class8NotesClass9NotesClass10NotesClass11NotesISROCSISROCSSolvedPapersISROCSOriginalPapersandOfficialKeysISROCSSyllabusforScientist/EngineerExamUGCNETCSUGCNETCSNotesPaperIIUGCNETCSNotesPaperIIIUGCNETCSSolvedPapersStudentCampusAmbassadorProgramSchoolAmbassadorProgramProjectGeekoftheMonthCampusGeekoftheMonthPlacementCourseCompetititveProgrammingTestimonialsGeekontheTopCareersInternshipJobsApplyforJobsPostaJobCourses ComewritearticlesforusandgetfeaturedLearnandcodewiththebestindustryexpertsGetaccesstoad-freecontent,doubtassistanceandmore!ComeandfindyourdreamjobwithusGeeksDigestQuizzesGeeksCampusGblogArticlesIDECampusMantri HomeSavedVideosCoursesGBlogPuzzlesWhat'sNew? ChangeLanguage DataStructuresAlgorithmsInterviewPreparationTopic-wisePracticeC++JavaPythonCompetitiveProgrammingMachineLearningWebDevelopmentPuzzlesProjectIdeasSchoolLearning RelatedArticles ▲RelatedArticlesConvertemojiintotextinPythonPythonprogramtoprintEmojisDrawsmilingfaceemojiusingTurtleinPythonDrawCircleinPythonusingTurtleDrawColorFilledShapesinTurtle–PythonTurtleProgramminginPythonDrawSquareandRectangleinTurtle–PythonDrawanypolygoninTurtle–PythonPython–DrawStarUsingTurtleGraphicsHowtodrawcolorfilledstarinPython-Turtle?DrawColourfulStarPatterninTurtle–PythonDrawSpiralingStarusingTurtleinPythonPython–Draw“GFG”logousingTurtleGraphicsDrawmovingobjectusingTurtleinPythonDrawaTicTacToeBoardusingPython-TurtleDrawChessBoardUsingTurtleinPythonDrawPandaUsingTurtleGraphicsinPythonDrawClockDesignusingTurtleinPythonCreatedigitalclockusingPython-TurtleMetaprogrammingwithMetaclassesinPythonClassandInstanceAttributesinPythonreflectioninPythonBarrierObjectsinPythonTimerObjectsinPythonHowToCreateaCountdownTimerUsingPython?AddingnewcolumntoexistingDataFrameinPandasPythonmap()functionTakinginputinPythonHowtogetcolumnnamesinPandasdataframeIterateoveralistinPythonTableofContentsConvertemojiintotextinPythonPythonprogramtoprintEmojisDrawsmilingfaceemojiusingTurtleinPythonDrawCircleinPythonusingTurtleDrawColorFilledShapesinTurtle–PythonTurtleProgramminginPythonDrawSquareandRectangleinTurtle–PythonDrawanypolygoninTurtle–PythonPython–DrawStarUsingTurtleGraphicsHowtodrawcolorfilledstarinPython-Turtle?DrawColourfulStarPatterninTurtle–PythonDrawSpiralingStarusingTurtleinPythonPython–Draw“GFG”logousingTurtleGraphicsDrawmovingobjectusingTurtleinPythonDrawaTicTacToeBoardusingPython-TurtleDrawChessBoardUsingTurtleinPythonDrawPandaUsingTurtleGraphicsinPythonDrawClockDesignusingTurtleinPythonCreatedigitalclockusingPython-TurtleMetaprogrammingwithMetaclassesinPythonClassandInstanceAttributesinPythonreflectioninPythonBarrierObjectsinPythonTimerObjectsinPythonHowToCreateaCountdownTimerUsingPython?AddingnewcolumntoexistingDataFrameinPandasPythonmap()functionTakinginputinPythonHowtogetcolumnnamesinPandasdataframeIterateoveralistinPythonImproveArticle SaveArticle LikeArticle PythonprogramtoprintEmojisDifficultyLevel: EasyLastUpdated: 15Nov,2021TherearemultiplewayswecanprinttheEmojisinPython.Let’sseehowtoprintEmojiswithUnicodes,CLDRnamesandemojimodule. UsingUnicodes: EveryemojihasaUnicodeassociatedwithit.EmojisalsohaveaCLDRshortname,whichcanalsobeused. Fromthelistofunicodes,replace“+”with“000”.Forexample–“U+1F600”willbecome“U0001F600”andprefixtheunicodewith“\”andprintit.  Attentiongeek!StrengthenyourfoundationswiththePythonProgrammingFoundationCourseandlearnthebasics. Tobeginwith,yourinterviewpreparationsEnhanceyourDataStructuresconceptswiththePythonDSCourse.AndtobeginwithyourMachineLearningJourney,jointheMachineLearning-BasicLevelCoursePython3#grinningfaceprint("\U0001f600") #grinningsquintingfaceprint("\U0001F606") #rollingonthefloorlaughingprint("\U0001F923")Output:    UsingCLDRshortname:  Python3#grinningfaceprint("\N{grinningface}") #slightlysmilingfaceprint("\N{slightlysmilingface}") #winkingfaceprint("\N{winkingface}")Output:    Usingemojimodule: EmojiscanalsobeimplementedbyusingtheemojimoduleprovidedinPython.Toinstallitrunthefollowingintheterminal. pipinstallemojiemojize()functionrequirestheCLDRshortnametobepassedinitastheparameter.Itthenreturnsthecorrespondingemoji.ReplacethespaceswithunderscoreintheCLDRshortname. Python3#importemojimoduleimportemoji  print(emoji.emojize(":grinning_face_with_big_eyes:"))print(emoji.emojize(":winking_face_with_tongue:"))print(emoji.emojize(":zipper-mouth_face:"))Output:    demojize()functionconvertstheemojipassedintoitscorrespondingCLDRshortname.    BelowisalistofsomecommonemojiUnicodeswiththeirCLDRshortnames: CLDRShortNameUnicodegrinningface  U+1F600grinningfacewithbigeyes  U+1F603grinningfacewithsmilingeyes  U+1F604beamingfacewithsmilingeyes  U+1F601grinningsquintingface  U+1F606grinningfacewithsweat  U+1F605rollingonthefloorlaughing  U+1F923facewithtearsofjoy  U+1F602slightlysmilingface  U+1F642upside-downface  U+1F643winkingfaceU+1F609smilingfacewithsmilingeyes  U+1F60Asmilingfacewithhalo  U+1F607smilingfacewith3heartsU+1F970smilingfacewithheart-eyesU+1F60Dstar-struck  U+1F929faceblowingakiss  U+1F618kissingface  U+1F617smilingface  U+263Akissingfacewithclosedeyes  U+1F61Akissingfacewithsmilingeyes  U+1F619facesavoringfood  U+1F60Bfacewithtongue  U+1F61Bwinkingfacewithtongue  U+1F61Czanyface  U+1F92Asquintingfacewithtongue  U+1F61Dmoney-mouthface  U+1F911huggingface  U+1F917facewithhandovermouth  U+1F92Dshushingface  U+1F92Bthinkingface  U+1F914zipper-mouthface  U+1F910facewithraisedeyebrow  U+1F928neutralface  U+1F610expressionlessface  U+1F611facewithoutmouth  U+1F636smirkingface  U+1F60Funamusedface  U+1F612facewithrollingeyes  U+1F644grimacingface  U+1F62Clyingface  U+1F925relievedface  U+1F60Cpensiveface  U+1F614sleepyface  U+1F62Adroolingface  U+1F924sleepingface  U+1F634facewithmedicalmask  U+1F637facewiththermometer  U+1F912facewithhead-bandage  U+1F915nauseatedface  U+1F922 MyPersonalNotes arrow_drop_upSave LikePreviousConvertemojiintotextinPythonNext DrawsmilingfaceemojiusingTurtleinPythonRecommendedArticlesPage:25,Apr2128,Sep1728,Dec1228,Dec1828,Aug2119,Dec1719,Dec1710,Nov1725,Jan1804,Apr1816,Jul1822,Oct1820,Oct1823,Oct1823,Oct1822,Oct1822,Oct1822,Oct1822,Oct1822,Oct1811,Nov1802,Aug0920,Dec1813,Jun19ArticleContributedBy:Yash_R@Yash_RVotefordifficultyCurrentdifficulty: EasyEasy Normal Medium Hard ExpertImprovedBy:varshagumber28ArticleTags:python-utilityPythonPythonProgramsReportIssueWritingcodeincomment? Pleaseuseide.geeksforgeeks.org, generatelinkandsharethelinkhere. LoadCommentsWhat'sNewViewDetailsViewDetailsViewDetailsMostpopularinPythonReadJSONfileusingPythonPythonDictionaryReadafilelinebylineinPythonHowtoInstallPIPonWindows?ReadingandWritingtotextfilesinPythonMostvisitedinPythonProgramsPythonprogramtoconvertalisttostringPython|GetdictionarykeysasalistDefaultdictinPythonPython|SplitstringintolistofcharactersHowtoprintwithoutnewlineinPython?× Weusecookiestoensureyouhavethebestbrowsingexperienceonourwebsite.Byusingoursite,you acknowledgethatyouhavereadandunderstoodour CookiePolicy& PrivacyPolicy GotIt!



請為這篇文章評分?