python3学习每日一题(3)


前言

今天的题目是遇到的最简单的一个直接使用字典


题目

In this Clash you have to recreate the emoji system of CodinGame.
For example, if you type this in the chat you get:
:slight_smile: --> 😃
😞 --> 😦
Input
An string s
Output
The string, with emojis inserted:
:slight_smile: —> 😃
😞 —> 😦
:loud_laugh: —> XD [not a real chat emoji conversion]
😮 —> 😮
😛 —> :p
THESE WILL BE THE ONLY EMOJIS COMING IN THE TEST CASES
Constraints
Length of s <= 100
Each word is seprated by a single whitespace
Example
Input
This is SOO easy :loud_laugh:
Output
This is SOO easy XD

直接上代码nobb(虽然还是菜)

代码如下:

import sys
import math
enjoy={"slight_smile":":)","disappointed":":(","loud_laugh":"XD","open_mouth":"o","stuck_out_tongue":"p"}
s=input()
s=s[:100]
print(enjoy[s])

总结

就能做简单的了菜菜死算了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值