-
Notifications
You must be signed in to change notification settings - Fork 0
/
day2_100.py
64 lines (47 loc) · 1.01 KB
/
day2_100.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
print("Getting to know you!")
print()
name = input("What's your name?: ")
food = input("What's your favorite food: ")
music = input("What's your favorite music? ")
loc = input("Where do you live?: ")
print()
print("You are")
print(name)
print("You're probably hankering for")
print(food)
print("and you're definitely getting your groove on to")
print(music)
print("living in the amazing")
print(loc)
print()
print("""
In C++ this is a similar way to do it:
========
#include <iostream>
#include <string>
using namespace std;
int main(){
string name;
cout << "Please enter your name: " << flush;
cin >> name;
cout << "Hello, " << name << endl;
return(0);
}
""")
print("""
In html/javascript this is a similar way to do it:
========
<!DOCTYPE html>
<html>
<body>
<input id="userinput"> <br>
<button onclick="greetings()"> Type your name and click </button>
<script>
function greetings() {
var name = document.getElementById("userinput").value;
document.write("Hello!!, " + name);
}
</script>
</body>
</html>
""")