我如何多次使用%s

时间:2018-04-06 13:07:54

标签: python

import time 
import sys
print ("Welcome to the annoying machine. Made by Bloody")
time.sleep(2)
print ("Here you will enjoy this annoying thingy.")
time.sleep(2)
print ("Have fun!")
time.sleep(2)
password = input("Enter new password:")
time.sleep(2)
print ("Your password is %s, remmeber this." % password)
name = input ("What is your name?")
time.sleep (1)

我有这个并且想要将%s用于2件事。我该怎么做?

1 个答案:

答案 0 :(得分:3)

$('.menu-buttons').bind('click', function() { var buttons = $('.menu-buttons'); buttons.toggleClass("active"); }); 运算符之后传递一个元组作为参数。

.active{
  background-color: lightslategray;
}

这称为(旧)printf-style String Formatting,它可以变得非常花哨。

相关问题